5 ms·
> The compiler could have prevented 'X' by not permitting "function == int" comparisons. That's 1/5. 0 is also a special case litteral for the null pointer, an
by emillon 13y ago
> The compiler could have prevented 'X' by not permitting "function == int" comparisons. That's 1/5.
0 is also a special case litteral for the null pointer, and function names are valid in pointer contexts, so I'm not even sure that "f == 0" is badly typed.
- kibibu 13y agoOnly in C++ pre C++11 - most C compilers use #define NULL ((void *)0) in which case, using NULL, you're comparing a function to a pointer.