[gdb/build] Fix Wlto-type-mismatch in opcodes/ft32-dis.c

Message ID 20230717084146.7978-1-tdevries@suse.de
State Accepted
Headers
Series [gdb/build] Fix Wlto-type-mismatch in opcodes/ft32-dis.c |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Tom de Vries July 17, 2023, 8:41 a.m. UTC
  Somebody on irc mentioned the following warning.

When building gdb with -O2 -flto, we run into:
...
opcodes/ft32-dis.c:30: warning: type of 'ft32_opc_info' does not match \
  original declaration [-Wlto-type-mismatch]
   30 | extern const ft32_opc_info_t ft32_opc_info[128];
      |
opcodes/ft32-opc.c:25: note: array types have different bounds
   25 | const ft32_opc_info_t ft32_opc_info[] =
      |
opcodes/ft32-opc.c:25: note: 'ft32_opc_info' was previously declared here
...

Fix this by using ft32_opc_info[] in opcodes/ft32-dis.c.

Tested on x86_64-linux.
---
 opcodes/ft32-dis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 8193fa9cbe1a6cdb2cb41cedb835de33a1c755e3
  

Patch

diff --git a/opcodes/ft32-dis.c b/opcodes/ft32-dis.c
index 493297549bf..4c7cac5968d 100644
--- a/opcodes/ft32-dis.c
+++ b/opcodes/ft32-dis.c
@@ -27,7 +27,7 @@ 
 #include "opcode/ft32.h"
 #include "disassemble.h"
 
-extern const ft32_opc_info_t ft32_opc_info[128];
+extern const ft32_opc_info_t ft32_opc_info[];
 
 static fprintf_ftype fpr;
 static void *stream;