
24 Oct
2006
24 Oct
'06
10:23 a.m.
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