diff mbox series

[5/5] libgm2/libm2pim/wrapc.cc: Define NULL as nullptr

Message ID e1836aac591d7753e45efccb3a982165081792a0.1728646712.git.alx@kernel.org
State New
Headers show
Series Provide better definitions of NULL | expand

Commit Message

Alejandro Colomar Oct. 11, 2024, 11:44 a.m. UTC
For internal C++ code, unconditionally define NULL as nullptr.
We already require a C++11 compiler to bootstrap GCC anyway.

Link: <https://software.codidact.com/posts/292718>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
 libgm2/libm2pim/wrapc.cc | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Gaius Mulley Oct. 17, 2024, 5:57 p.m. UTC | #1
Alejandro Colomar <alx@kernel.org> writes:

> For internal C++ code, unconditionally define NULL as nullptr.
> We already require a C++11 compiler to bootstrap GCC anyway.
>
> Link: <https://software.codidact.com/posts/292718>
> Signed-off-by: Alejandro Colomar <alx@kernel.org>
> ---
>  libgm2/libm2pim/wrapc.cc | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/libgm2/libm2pim/wrapc.cc b/libgm2/libm2pim/wrapc.cc
> index 5c31f1e2687..cdd1cf0d0fe 100644
> --- a/libgm2/libm2pim/wrapc.cc
> +++ b/libgm2/libm2pim/wrapc.cc
> @@ -63,10 +63,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>  #include <fcntl.h>
>  #endif
>  
> -/* Define a generic NULL if one hasn't already been defined.  */
> -
>  #if !defined(NULL)
> -#define NULL 0
> +#define NULL nullptr
>  #endif
>  
>  /* strtime returns the address of a string which describes the

lgtm - thanks!
diff mbox series

Patch

diff --git a/libgm2/libm2pim/wrapc.cc b/libgm2/libm2pim/wrapc.cc
index 5c31f1e2687..cdd1cf0d0fe 100644
--- a/libgm2/libm2pim/wrapc.cc
+++ b/libgm2/libm2pim/wrapc.cc
@@ -63,10 +63,8 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include <fcntl.h>
 #endif
 
-/* Define a generic NULL if one hasn't already been defined.  */
-
 #if !defined(NULL)
-#define NULL 0
+#define NULL nullptr
 #endif
 
 /* strtime returns the address of a string which describes the