From: Tom Tromey Date: Fri, 25 Apr 2025 17:38:34 +0000 (-0600) Subject: Fix d10v sim build with GCC 15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=888a2e22a83582e437d128b6a498c2d8502a7ad0;p=thirdparty%2Fbinutils-gdb.git Fix d10v sim build with GCC 15 The d10v sim fails when built with GCC 15. From the bug: d10v/table.c:171:17: error: initialization of ‘void (*)(struct sim_state *, SIM_CPU *)’ {aka ‘void (*)(struct sim_state *, struct _sim_cpu *)’} from incompatible pointer type ‘void (*)(void)’ [-Wincompatible-pointer-types] 171 | { 0,0,0,0,0,0,0,(void (*)())0,0,{0,0,0}}, | ^ d10v/table.c:171:17: note: (near initialization for ‘Simops[165].func’) The bug here is that this is the wrong function pointer type. Since '0' is perfectly fine here, this patch simply removes the cast. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32900 Approved-By: Tom de Vries --- diff --git a/sim/d10v/gencode.c b/sim/d10v/gencode.c index 3a37bac6256..763e2f57a46 100644 --- a/sim/d10v/gencode.c +++ b/sim/d10v/gencode.c @@ -150,5 +150,5 @@ write_opcodes (void) printf ("},\n"); } } - printf ("{ 0,0,0,0,0,0,0,(void (*)())0,0,{0,0,0}},\n};\n"); + printf ("{ 0,0,0,0,0,0,0,0,0,{0,0,0}},\n};\n"); }