ISO C 23 now has nullptr, as well as the nullptr_t type. The proposal that introduced it has some rationale.

Answer from Bruno Haible on Stack Overflow
🌐
Reddit
reddit.com › r/programmingcirclejerk › already in c17 (void*)null is not always a null pointer constant.
r/programmingcirclejerk on Reddit: Already in C17 (void*)NULL is not always a null pointer constant.
January 10, 2023 - Plus, since nullptr is a defined macro which replaces the keyword with said constant, we now have a field day for those hacking mfs that disassemble our packed binary.
🌐
GNU
gcc.gnu.org › pipermail › gcc-patches › 2022-August › 600257.html
[PATCH v2] c: Implement C23 nullptr (N3042)
> > diff --git a/gcc/testsuite/gcc.dg/c2x-nullptr-4.c b/gcc/testsuite/gcc.dg/c2x-nullptr-4.c > > new file mode 100644 > > index 00000000000..5b15e75d159 > > --- /dev/null > > +++ b/gcc/testsuite/gcc.dg/c2x-nullptr-4.c > > @@ -0,0 +1,10 @@ > > +/* Test that we warn about `nullptr' pre-C2X. */ > > +/* { dg-do compile } */ > > +/* { dg-options "-std=c17 -pedantic-errors" } */ > > This test is wrong - it's a normal identifier pre-C2x - but tests for > previous standard versions shouldn't be called c2x-* in any case.
🌐
Open-std
open-std.org › jtc1 › sc22 › WG14 › www › docs › n3077.htm
handle NB comments concerning nullptr
January 8, 2023 - Add (void*)nullptr to the list of allowed forms of a null pointer constant. No this was not an oversight, but a choice. Already in C17 (void*)NULL is not always a null pointer constant.
🌐
GitHub
github.com › AshenskyABCDE › C-17- › blob › master › nullptr.cpp
C-17-/nullptr.cpp at master · AshenskyABCDE/C-17-
Contribute to AshenskyABCDE/C-17- development by creating an account on GitHub.
Author   AshenskyABCDE
🌐
Codidact
software.codidact.com › posts › 289414
What is C23 and why should I care? - Software Development
It is a constant guaranteed to be a null pointer constant much like NULL has always been, but without all the subtle stuff like 0 being a either a null pointer constant or an integer constant (see What's the difference between null pointers ...
🌐
Cppreference
en.cppreference.com › w › cpp › language › nullptr.html
nullptr, the pointer literal (since C++11) - cppreference.com
The keyword nullptr denotes the pointer literal. It is a prvalue of type std::nullptr_t. There exist implicit conversions from nullptr to null pointer value of any pointer type and any pointer to member type. Similar conversions exist for any null pointer constant, which includes values of ...
Find elsewhere
🌐
Quora
quora.com › Is-it-safe-to-delete-a-nullptr-twice-in-c-c-c-11-c-17-c-14-development
Is it safe to delete a nullptr twice in c++ (c++, c++11, c++17, c++14, development)? - Quora
No. It’s a misguided attempt at error handling. The C- way of error handling, which does not apply to the C++ operator new any more. If you were using malloc, then checking if the pointer is a nullptr would catch a bad allocation where the allocator could not satisfy the request for allocation.
🌐
YouTube
youtube.com › watch
Understanding nullptr in C: A Deep Dive into Null Pointers in Modern C Standards - YouTube
Explore the nuances of null pointers in modern C standards (C11, C17) and discover why `nullptr` is not part of the language, including alternatives like `NU...
Published   April 5, 2025
Views   0
🌐
LLVM Discussion Forums
discourse.llvm.org › clang frontend
ISO C3X proposal: nonnull qualifier - Page 3 - Clang Frontend - LLVM Discussion Forums
August 5, 2022 - Hi all, I'd like to propose the following feature for ISO C (and also ISO C++). It is based on a mix of GCC's [[gnu::nonnull]] and Clang's _Nonnull, with a pinch of salt of mine. I'd like to get some feedback from GC…
🌐
Cppreference
en.cppreference.com › w › c › language › nullptr.html
Predefined null pointer constant (since C23) - cppreference.com
The keyword nullptr denotes a predefined null pointer constant. It is a non-lvalue of type nullptr_t.
🌐
C++ Stories
cppstories.com › 2018 › 05 › using-optional
Using C++17 std::optional - C++ Stories
May 7, 2018 - While you can achieve “null-ability” by using unique values (-1, infinity, nullptr), it’s not as clear as the separate wrapper type.
🌐
DEV Community
dev.to › pauljlucas › nullptr-in-c23-1cn6
nullptr in C23 - DEV Community
July 8, 2025 - Like void* and 0, nullptr implicitly converts to any type of pointer; unlike NULL, it’s guaranteed to be a pointer.
🌐
Simplifycpp
simplifycpp.org
What's New in the C23 Standard for the C Programming ...
Unlike NULL, which is typically defined as 0 or ((void*)0), nullptr is type-safe and avoids ambiguities in pointer comparisons.
🌐
MC++ BLOG
modernescpp.com › index.php › the-null-pointer-constant-nullptr
The Null Pointer Constant nullptr – MC++ BLOG
The null pointer constant behaves like a boolean value initialized with false. You can observe that in lines 22 – 25. If the nullptr has to decide between a long int and a pointer, it will decide on a pointer (line 28).
🌐
Microsoft
devblogs.microsoft.com › dev blogs › the old new thing › when msdn says null, is it okay to use nullptr?
When MSDN says NULL, is it okay to use nullptr? - The Old New Thing
March 13, 2019 - If NULL is defined as (void*)0 in C or as nullptr in C++, then it can be assigned only to a pointer type. And since MSDN cannot control how the C and C++ header files define NULL, it needs to work with any definition that is permitted by the ...
🌐
Wikipedia
en.wikipedia.org › wiki › C23_(C_standard_revision)
C23 (C standard revision) - Wikipedia
April 9, 2026 - The common names "C17" and "C23" reflect these values, which are frozen prior to final adoption, rather than the years in the ISO standards identifiers (9899:2018 and 9899:2024). Changes integrated into the latest working draft of C23 are listed below. Add nullptr constant for nullptr_t type.