Skip to content

Commit 325a9d1

Browse files
committed
tools.c: do not use keywords 'nullptr' as a variable in code
Without the patch: tools.c: In function ‘drop_core’: tools.c:6251:23: error: expected identifier or ‘(’ before ‘nullptr’ 6251 | volatile int *nullptr; | ^~~~~~~ tools.c:6259:17: error: lvalue required as left operand of assignment 6259 | nullptr = NULL; | ^ tools.c:6261:21: error: invalid type argument of unary ‘*’ (have ‘typeof (nullptr)’) 6261 | i = *nullptr; | ^~~~~~~~ make[6]: *** [Makefile:345: tools.o] Error 1 Note: this was observed on gcc version 15.0.1 Signed-off-by: Lianbo Jiang <[email protected]>
1 parent 772fbb1 commit 325a9d1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6248,17 +6248,17 @@ lowest_bit_long(ulong val)
62486248
void
62496249
drop_core(char *s)
62506250
{
6251-
volatile int *nullptr;
6251+
volatile int *ptr;
62526252
int i ATTRIBUTE_UNUSED;
62536253

62546254
if (s && ascii_string(s))
62556255
fprintf(stderr, "%s", s);
62566256

62576257
kill((pid_t)pc->program_pid, 3);
62586258

6259-
nullptr = NULL;
6259+
ptr = NULL;
62606260
while (TRUE)
6261-
i = *nullptr;
6261+
i = *ptr;
62626262
}
62636263

62646264

0 commit comments

Comments
 (0)