This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Avoid array-bounds warning in testsuite on i586
- From: Andreas Schwab <schwab at suse dot de>
- To: libc-alpha at sourceware dot org
- Date: Wed, 29 Jun 2016 11:08:05 +0200
- Subject: [PATCH] Avoid array-bounds warning in testsuite on i586
- Authentication-results: sourceware.org; auth=none
gcc-6 is complaining about this, breaking the testsuite run:
In file included from ../string/string.h:627:0,
from ../include/string.h:54,
from tester.c:32,
from inl-tester.c:6:
tester.c: In function 'test_strncat':
../sysdeps/x86/bits/string.h:1092:3: error: array subscript is below array bounds [-Werror=array-bounds]
--__tmp;
^~~~~~~
I don't see any other way to avoid the warning.
Andreas.
[BZ #20260]
* sysdeps/i386/Makefile (CFLAGS-inl-tester.c): Define.
* string/Makefile (CFLAGS-inl-tester.c, CFLAGS-noinl-tester.c)
(CFLAGS-tst-strlen.c, CFLAGS-stratcliff.c, CFLAGS-test-ffs.c)
(CFLAGS-tst-inlcall.c): Append value.
---
string/Makefile | 12 ++++++------
sysdeps/i386/Makefile | 4 ++++
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/string/Makefile b/string/Makefile
index 9c87419..48a0e85 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -64,12 +64,12 @@ endif
include ../Rules
-CFLAGS-inl-tester.c = -fno-builtin
-CFLAGS-noinl-tester.c = -fno-builtin
-CFLAGS-tst-strlen.c = -fno-builtin
-CFLAGS-stratcliff.c = -fno-builtin
-CFLAGS-test-ffs.c = -fno-builtin
-CFLAGS-tst-inlcall.c = -fno-builtin
+CFLAGS-inl-tester.c += -fno-builtin
+CFLAGS-noinl-tester.c += -fno-builtin
+CFLAGS-tst-strlen.c += -fno-builtin
+CFLAGS-stratcliff.c += -fno-builtin
+CFLAGS-test-ffs.c += -fno-builtin
+CFLAGS-tst-inlcall.c += -fno-builtin
ifeq ($(run-built-tests),yes)
$(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile
index 6c91842..a0e80a9 100644
--- a/sysdeps/i386/Makefile
+++ b/sysdeps/i386/Makefile
@@ -7,6 +7,10 @@ long-double-fcts = yes
ifeq ($(subdir),string)
sysdep_routines += cacheinfo
+
+# Suppress array bounds warning from strncat macro in
+# sysdeps/x86/bits/string.h when building for i[345]86
+CFLAGS-inl-tester.c += -Wno-array-bounds
endif
ifeq ($(subdir),gmon)
--
2.9.0
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."