]> sourceware.org Git - glibc.git/commitdiff
Fix -Os strcoll, wcscoll, build (bug 21313).
authorJoseph Myers <joseph@codesourcery.com>
Wed, 7 Feb 2018 13:36:14 +0000 (13:36 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 7 Feb 2018 13:36:14 +0000 (13:36 +0000)
The findidx functions used in implementing strcoll / wcscoll already
use DIAG_IGNORE_Os_NEEDS_COMMENT for spurious -Wmaybe-uninitialized
warnings that appear with -Os.  In building with GCC 7 for x86_64 with
-Os, I find there are additional such warnings, for the same structure
elements, which are spurious for the same reasons given in the
existing comments (and this was also reported for MIPS with GCC 5 in
bug 21313).  This patch adds corresponding uses of DIAG_* in the
places that get the additional warnings.

Tested for x86_64 with -Os that this eliminates those warnings and so
allows the build to progress further.

[BZ #21313]
* locale/weight.h (findidx): Disable -Wmaybe-uninitialized for -Os
in another place.
* locale/weightwc.h (findidx): Likewise.

ChangeLog
locale/weight.h
locale/weightwc.h

index d823e3ac3bca12ca73fb6250800bb0c6e9902ccc..7ff1ffb2ea8d4b54e578d942d021f77a59aa8eb9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-02-07  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #21313]
+       * locale/weight.h (findidx): Disable -Wmaybe-uninitialized for -Os
+       in another place.
+       * locale/weightwc.h (findidx): Likewise.
+
 2018-02-07  Wilco Dijkstra  <wdijkstr@arm.com>
 
        * manual/probes.texi (slowlog): Delete documentation of removed probe.
index e2fdae17136498459f896c94129bbc65ed133008..6028d3595e41cd9cc53fb4e6b7d766714e51a451 100644 (file)
@@ -132,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);
            }
index 682d2b4eafce0392e6fd7cf225294401786dcd55..ac25ba95b97512c9b867f79d7e71774447239f99 100644 (file)
@@ -90,9 +90,16 @@ findidx (const int32_t *table,
          size_t cnt;
          size_t offset;
 
+         /* 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");
          for (cnt = 0; cnt < nhere - 1 && cnt < len; ++cnt)
            if (cp[cnt] != usrc[cnt])
              break;
+         DIAG_POP_NEEDS_COMMENT;
 
          if (cnt < nhere - 1)
            {
This page took 0.085972 seconds and 5 git commands to generate.