[Monetdb-developers] Signed/unsigned and NULL

Sjoerd Mullender sjoerd at acm.org
Tue Oct 24 10:23:38 CEST 2006


On 2006-10-24 10:16, Fabian Groffen wrote:
> I just figured that the following yields in a signed/unsigned warning:
> 
>  1  void myfunc(char *s) {
>  2   if (s != NULL) {
>  3      ...
>  4    }
>  5  }
> 
> The error occurs on line 2.  I cannot find the definition of NULL, but I
> suspect it is defined like:
> #define NULL 0
> 
> Obviously 0 is signed while s (pointer) is not.  Maybe we should use
> #define NULL (char*)0
> instead?

Which compiler?  Which options?

No, do not redefine NULL.  It is defined in the standard include files
and should not be changed.

-- 
Sjoerd Mullender

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 370 bytes
Desc: OpenPGP digital signature
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20061024/be159f67/attachment.sig>


More information about the developers-list mailing list