[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: bug in gcc?
- From: eugeny gladkih <john@...>
- Date: Wed, 04 Apr 2007 22:20:55 +0400
>>>>> "RI" == Roberto Ierusalimschy <email@example.com> writes:
RI> When I compile lpeg (version 0.5) with g++ (that is, as C++ code), I get
RI> the following error:
RI> lpeg.c:395: error: invalid conversion from ‘int’ to ‘const char*’
RI> That line is as follows:
RI> return luaL_error(L, "too many pending calls/choices"), NULL;
RI> (The function actually returns 'const char *'). If I remove the
RI> LuaL_error call from the expression, the error disapears. (So, it seems
RI> that NULL is still compatible with const char* ;) Parentheses around the
RI> comma expression have no effect. Is this a bug in gcc? Or am I doing
RI> something stupid?
RI> I am using gcc version 4.0.3.
there is no implicit conversion between pointer and integer in
C++. so, compiler authors use various tricks ;)
look through stddef.h:
#define NULL __null
Yours sincerely, Eugeny.
Doctor Web, Ltd. http://www.drweb.com