|
From: | Jakub Wilk |
Subject: | Re: [PATCH v3] NULL.3const: Add documentation for NULL |
Date: | Mon, 25 Jul 2022 20:57:04 +0200 |
* Alejandro Colomar <alx.manpages@gmail.com>, 2022-07-24, 21:19:
+.B "#define NULL ((void *) 0)" +.fi +.SH DESCRIPTION +.B NULL +represents a null pointer constant. +.PP +According to POSIX, +it shall expand to an integer constant expression with the value +.B 0 +cast to type +.IR "void *" .
Might be worth noting that the cast requirement was added only in POSIX.1-2008 aka SUSv4.
+.SH CONFORMING TO +C99 and later;
It's in C89 too.
+.I NULL \- NULL +is, surprisingly, undefined behavior, according to ISO C.
FWIW, I don't find it surprising at all. -- Jakub Wilk
[Prev in Thread] | Current Thread | [Next in Thread] |