I have seen below macro in many topmost header files:
#define NULL 0 // C++03
In all over the code, NULL
and 0
are u
No. You're not allowed to (re)define standard macros. And if you see
#define NULL 0
at the top of any file other than a standard header (and even there, it should be in include guards, and typically in additional guards as well), then that file is broken. Remove it.
Note that good compilers will typically define NULL
with something
like:
#define NULL __builtin_null
, to access a compiler builtin which will trigger a warning if it is used in a non-pointer context.