This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4622. Is NULL allowed to be expanded to an extension?

Section: 17.2.3 [support.types.nullptr] Status: New Submitter: Jiang An Opened: 2026-09-14 Last modified: 2026-09-19

Priority: Not Prioritized

View all other issues in [support.types.nullptr].

View all issues with New status.

Discussion:

In some current implementations (e.g., in GCC and Clang's own <stddef.h> header), the NULL macro may be expanded to the __null extension (demo). Although __null can be used interchangeably with zero-value integer literals of the same type in most contexts, its exact spelling is observable.

LWG 4182(i) requires NULL to be expanded to a literal, and a pedantic reading may suggest that only standard literals are permitted. In other words, if a program requires NULL to be expanded as a standard literal (in either compile time or runtime), LWG 4182(i) seemingly requires implementations to support it, which in turns renders the existing use of the __null extension non-conforming.

Proposed resolution: