Hello
This is a little test case. It is not real code.
We used gcc-8 to get some warnings, but on the godbolt trunk gcc doesn't
those warnings with this little test case. Am I missing something
obvious? Is this an issue?
with gcc-8 only (1) of the (3) occurrences of NULL is warned.
Cheers, Jonny
myfile.cpp:100:15 error: zero as null pointer constant
[-Werror=zero-as-null-pointer-constant]
if(NULL == format)
^~~~~~
Options
-Wall -Wextra -Werror=zero-as-null-pointer-constant
#include <cstddef>
int str(const char * const format, ...)
{
if(NULL == format) // gcc-8 warning
{
return -1;
}
return 0;
}
int main()
{
char * buf = NULL;
str(buf);
return (NULL == buf);
}