From: Alan Modra Date: Sat, 24 Feb 2018 00:03:33 +0000 (+1030) Subject: crx string overflow warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e95b887f85a192eb1597cd5d358673520029ad14;p=binutils-gdb.git crx string overflow warning gcc8 complains wrongly about the buffer not being large enough, at least at -Og optimization. * crx-dis.c (getregliststring): Allocate a large enough buffer to silence false positive gcc8 warning. --- diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 325972faeb8..0f47a20fdd0 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2018-02-26 Alan Modra + + * crx-dis.c (getregliststring): Allocate a large enough buffer + to silence false positive gcc8 warning. + 2018-02-22 Shea Levy * disassemble.c (ARCH_riscv): Define if ARCH_all. diff --git a/opcodes/crx-dis.c b/opcodes/crx-dis.c index a70ab81aac4..27a2aa80289 100644 --- a/opcodes/crx-dis.c +++ b/opcodes/crx-dis.c @@ -244,7 +244,7 @@ powerof2 (int x) void getregliststring (int mask, char *string, enum REG_ARG_TYPE core_cop) { - char temp_string[5]; + char temp_string[16]; int i; string[0] = '{';