Re: [PATCH v3] NULL.3const: Add documentation for NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Alejandro Colomar <alx.manpages@xxxxxxxxx>, 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



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux