This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Avoid array-bounds warning in testsuite on i586
- From: Florian Weimer <fweimer at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>, libc-alpha at sourceware dot org
- Date: Wed, 29 Jun 2016 13:32:47 +0200
- Subject: Re: [PATCH] Avoid array-bounds warning in testsuite on i586
- Authentication-results: sourceware.org; auth=none
- References: <mvm60ssicqy dot fsf at hawking dot suse dot de>
On 06/29/2016 11:08 AM, Andreas Schwab wrote:
gcc-6 is complaining about this, breaking the testsuite run:
In file included from ../string/string.h:627:0,
tester.c: In function 'test_strncat':
../sysdeps/x86/bits/string.h:1092:3: error: array subscript is below array bounds [-Werror=array-bounds]
I don't see any other way to avoid the warning.
We could move the decrement operation into the assembly part, where GCC
cannot see it. Or we could cast to uintptr_t before subtracting 1.
+# Suppress array bounds warning from strncat macro in
+# sysdeps/x86/bits/string.h when building for i86
+CFLAGS-inl-tester.c += -Wno-array-bounds
It's triggered by an installed header, so this does not fix the bug at
all. I expect applications run into the warning as well.