diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-08-30 23:10:39 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-08-30 23:12:35 +0200 |
commit | e52881724836a9ab70a5f76354ec77cbbd94aeb1 (patch) | |
tree | e327d3a84b89c63ceeeb9a287c3a45dcaf83981e | |
parent | add prototypes for brk and sbrk (diff) | |
download | slibc-e52881724836a9ab70a5f76354ec77cbbd94aeb1.tar.gz slibc-e52881724836a9ab70a5f76354ec77cbbd94aeb1.tar.bz2 slibc-e52881724836a9ab70a5f76354ec77cbbd94aeb1.tar.xz |
null considered harmful considered harmful
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r-- | include/stddef.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/stddef.h b/include/stddef.h index 275e53c..0e10989 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -28,6 +28,18 @@ * the same width and ISO C does not specify it this * way), use to indicate that a pointer does not point * to anything. + * + * Note on considerations of `NULL` being harmful: + * It is important to remember than `sizeof(NULL)` + * does not equal `sizeof(int)` on all machines. + * Therefore, in variadic arguments, it is important + * not to substitute `x` for `x != NULL`. This + * would cause horrible bugs. If you insist on not + * using `NULL`, correct substitutions would be + * `!!x` or `x != 0`. + * Note that `NULL` is genuinely harmful in C++, + * but excessive use of C++, and especially it + * features, is harmful too. */ #ifndef NULL # define NULL ((void*)0) |