This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Pointer woes... (int) 0 or (void *) 0 for NULL???


Mark Schaefer wrote:

>     In the egcs distribution is a set of C++ include files that are by
> default installed into /usr/local/include.  Two files (libio.h, and
> streambuf.h) have the following code:
>
> #ifndef NULL
> #ifdef __GNUG__
> #define NULL (__null)
> #else
> #define NULL (0)
> #endif
> #endif
>
>     That macro is killing me for some reason.  I keep on getting this
> error:
> cannot convert `0' from type `{unknown type} *' to type `void
> (UiCallbackHandler::*)(_WidgetRec *, void *, void *)'

Could this be a bug in egcs' interpretation of __null?

The error message seems to say that you're trying to assign a pointer to a
pointer-to-member; that's not allowed in C++. The meaning of __null in such
a context should not be `{unknown type} *', it should be, e.g., `{unknown
class} ::*'.

--
Branko Cibej   <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
phone: (++386 61) 186 53 49  fax: (++386 61) 186 52 70




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]