]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - locale/weight.h
locale: prevent maybe-uninitialized errors with -Os [BZ #19444]
[thirdparty/glibc.git] / locale / weight.h
index 8be2d220f814fbbcb85c506a0911d4215324203c..4a4d5aa6b261ab4e3bc116efc85ce0e49721a38b 100644 (file)
@@ -27,7 +27,14 @@ findidx (const int32_t *table,
         const unsigned char *extra,
         const unsigned char **cpp, size_t len)
 {
+  /* With GCC 8 when compiling with -Os the compiler warns that
+     seq1.back_us and seq2.back_us might be used uninitialized.
+     This uninitialized use is impossible for the same reason
+     as described in comments in locale/weightwc.h.  */
+  DIAG_PUSH_NEEDS_COMMENT;
+  DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
   int32_t i = table[*(*cpp)++];
+  DIAG_POP_NEEDS_COMMENT;
   const unsigned char *cp;
   const unsigned char *usrc;