Page MenuHome GnuPG

libgpg-error: nullptr
Open, Needs TriagePublic

Description

{F16027297}libgpg-error: 1.50
gcc (GCC) 15.0.0 20240509 (experimental)

as of c23 'nullptr' is a reserved word in C https://en.cppreference.com/w/c/language/nullptr

unfortunately some of the tests of libgpg-error use 'nullptr'
so when i compile with $CFLAGS including -std=gnu23 with a gcc that supports c23 libgpg-error fails to compile

t-printf.c: In function ‘check_fprintf_sf’:
t-printf.c:452:18: error: expected identifier or ‘(’ before ‘nullptr’

452 |   volatile char *nullptr = NULL; /* Avoid compiler warning.  */

the fix is simple enough: rename nullptr to something else (i used nullptr1)

attached patch results in a successful compilation/test run.

Details

Version
1.50