From patchwork Wed Jun 29 09:08:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 13466 Received: (qmail 80303 invoked by alias); 29 Jun 2016 09:08:20 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 80279 invoked by uid 89); 29 Jun 2016 09:08:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=__tmp, 76 X-HELO: mx2.suse.de From: Andreas Schwab To: libc-alpha@sourceware.org Subject: [PATCH] Avoid array-bounds warning in testsuite on i586 X-Yow: I appoint you ambassador to Fantasy Island!!! Date: Wed, 29 Jun 2016 11:08:05 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 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)