ToT build error with ToT GCC on Aarch64
Andreas Schwab
schwab@suse.de
Tue Jul 24 16:10:00 GMT 2018
On Jul 23 2018, Steve Ellcey <sellcey@cavium.com> wrote:
> In file included from fnmatch.c:244:
> fnmatch_loop.c: In function âinternal_fnwmatchâ:
> ../locale/weightwc.h:124:28: error: array subscript 1 is outside array bounds of
> Â âwint_t[1]â {aka âunsigned int[1]â} [-Werror=array-bounds]
> Â Â Â Â if (cp[nhere - 1] > usrc[nhere -1])
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ~~~~^~~~~~~~~~
> In file included from fnmatch.c:244:
> fnmatch_loop.c: In function âinternal_fnwmatchâ:
> ../locale/weightwc.h:124:28: error: array subscript 1 is outside array bounds of
> Â âwint_t[1]â {aka âunsigned int[1]â} [-Werror=array-bounds]
> Â Â Â Â if (cp[nhere - 1] > usrc[nhere -1])
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ~~~~^~~~~~~~~~
> cc1: all warnings being treated as errors
> ../o-iterator.mk:9: recipe for target '/home/sellcey/tot/obj/glibc64/posix/fnmat
> ch.o' failed
I think this is the correct change. The cnt == len check matches what
is done in weight.h, and is needed when nhere - 1 == len and usrc is a
prefix of cp.
Andreas.
* locale/weightwc.h (findidx): Handle the case where usrc is a
prefix of cp but one character too short.
---
locale/weightwc.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/locale/weightwc.h b/locale/weightwc.h
index 36c65b5623..7ee335dc9a 100644
--- a/locale/weightwc.h
+++ b/locale/weightwc.h
@@ -109,7 +109,7 @@ findidx (const int32_t *table,
break;
DIAG_POP_NEEDS_COMMENT;
- if (cnt < nhere - 1)
+ if (cnt < nhere - 1 || cnt == len)
{
cp += 2 * nhere;
continue;
@@ -121,14 +121,14 @@ findidx (const int32_t *table,
same reason as described above. */
DIAG_PUSH_NEEDS_COMMENT;
DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
- if (cp[nhere - 1] > usrc[nhere -1])
+ if (cp[nhere - 1] > usrc[nhere - 1])
{
cp += 2 * nhere;
continue;
}
DIAG_POP_NEEDS_COMMENT;
- if (cp[2 * nhere - 1] < usrc[nhere -1])
+ if (cp[2 * nhere - 1] < usrc[nhere - 1])
{
cp += 2 * nhere;
continue;
--
2.18.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."
More information about the Libc-alpha
mailing list