crx string overflow warning

Alan Modra amodra@gmail.com
Mon Feb 26 00:17:00 GMT 2018


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/crx-dis.c b/opcodes/crx-dis.c
index a70ab81..27a2aa8 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] = '{';

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list