I recently stumbled across the following behaviour of gcc 3.2.2 writing a c program:
In an if statement I forgot the braces of a function and wrote:
if
myFunc
is simply the memory address of the function, and is non-zero.
Your if-statement is pretty much the same as writing:
if (0x08451234) { ... }
And as a non-zero value, it is true
.
No warning seems appropriate, as it is valid and even somewhat common to test function-pointers to see if they are NULL or not.