summaryrefslogtreecommitdiff
path: root/locale/weight.h
diff options
context:
space:
mode:
Diffstat (limited to 'locale/weight.h')
-rw-r--r--locale/weight.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/locale/weight.h b/locale/weight.h
index c99730c4fb..6028d3595e 100644
--- a/locale/weight.h
+++ b/locale/weight.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper, <drepper@cygnus.com>.
@@ -19,6 +19,8 @@
#ifndef _WEIGHT_H_
#define _WEIGHT_H_ 1
+#include <libc-diag.h>
+
/* Find index of weight. */
static inline int32_t __attribute__ ((always_inline))
findidx (const int32_t *table,
@@ -61,9 +63,17 @@ findidx (const int32_t *table,
already. */
size_t cnt;
+ /* With GCC 5.3 when compiling with -Os the compiler warns
+ that seq2.back_us, which becomes usrc, might be used
+ uninitialized. This can't be true because we pass a length
+ of -1 for len at the same time which means that this loop
+ never executes. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
for (cnt = 0; cnt < nhere && cnt < len; ++cnt)
if (cp[cnt] != usrc[cnt])
break;
+ DIAG_POP_NEEDS_COMMENT;
if (cnt == nhere)
{
@@ -122,7 +132,15 @@ findidx (const int32_t *table,
do
{
offset <<= 8;
+ /* With GCC 7 when compiling with -Os the compiler
+ warns that seq1.back_us and seq2.back_us, which
+ become usrc, might be used uninitialized. This
+ is impossible for the same reason as described
+ above. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
offset += usrc[cnt] - cp[cnt];
+ DIAG_POP_NEEDS_COMMENT;
}
while (++cnt < nhere);
}