C++ definition of NULL

Chad Gatesman chadg@redrose.net
Tue Mar 2 21:13:00 GMT 1999


Jason Merrill wrote:

>  > I am currently porting a very large library that depends on the passing
>  > of NULL into parameters declared as long int.
>
>  > egcs appears to define NULL as __null which is a builtin symbol that
>  > treats NULL as `{unknown type} *'.  Therefore, I cannot pass in NULL to
>  > a long int parameter without casting it.
>
> Why would you want to?  Conceptually, NULL is a pointer value.

I see what you are saying, but unfortunately, this is not my code.  I am
mearly porting it.  And, technically, it should work since the standard says
NULL should be a 0 or 0L

Chad Gatesman



More information about the Gcc mailing list