This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]