Not true. In ANSI/ISO C, a null pointer constant is either an integer
constant expression with the value 0, or such an expression cast to
void*. NULL expands to an implementation defined null pointer
conatant, so both
#define NULL (void*)0
and
#define NULL 0
are suitable, and the latter also meets the C++ standard.
> There
> should not be any kernel headers included in an C++ code. Headers that
> could be included are protected with conditional statements like:
>
> #ifndef NULL
> #ifdef __cplusplus
> #define NULL 0
> #else
> #define NULL (void*)0
> #endif
> #endif
>
> This was from <stdio.h>......
That's perfectly correct, and is the traditional definition in order
to support pre-standard C compilers, but not strictly necessary on
Linux where all the widely and not-so-widely used C compilers support
the standard.
David Wragg
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/