]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix d10v sim build with GCC 15
authorTom Tromey <tromey@adacore.com>
Fri, 25 Apr 2025 17:38:34 +0000 (11:38 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 25 Apr 2025 20:38:11 +0000 (14:38 -0600)
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 <tdevries@suse.de>
sim/d10v/gencode.c

index 3a37bac62563f56a5070c690faf97028614b5d12..763e2f57a469ea590f333c511093d5e4353af282 100644 (file)
@@ -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");
 }