]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Disable -Wmaybe-uninitialized for total_deadline in sunrpc/clnt_udp.c.
authorJoseph Myers <joseph@codesourcery.com>
Wed, 2 Oct 2019 21:12:17 +0000 (21:12 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 2 Oct 2019 21:12:17 +0000 (21:12 +0000)
To work around <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91691>
for RV32, we recently disabled -Wmaybe-uninitialized for some inline
functions in inet/net-internal.h, as included by sunrpc/clnt_udp.c.

The same error has now appeared with current GCC trunk for MIPS, in a
form that is located at the definition of the variable in question and
so unaffected by the disabling in inet/net-internal.h.  Thus, this
patch adds the same disabling around the definition of that variable,
to cover the MIPS case.

Tested with build-many-glibcs.py (compilers and glibcs stages) for
mips64-linux-gnu with GCC mainline.

* sunrpc/clnt_udp.c: Include <libc-diag.h>.
(clntudp_call): Disable -Wmaybe-uninitialized around declaration
of total_deadline.

ChangeLog
sunrpc/clnt_udp.c

index c0d97f5b4e7ddf0ba35b2ec6dbe1171135eba51c..601403aedd2efed898481fe6995d3b59b1bf6e64 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-10-02  Joseph Myers  <joseph@codesourcery.com>
+
+       * sunrpc/clnt_udp.c: Include <libc-diag.h>.
+       (clntudp_call): Disable -Wmaybe-uninitialized around declaration
+       of total_deadline.
+
 2019-10-02  Alistair Francis  <alistair.francis@wdc.com>
 
        * string/endian.h: Restore the __USE_MISC conditionals.
index c2436e3ebcc8cb289ff8152e06f9e5a7f625392b..ee79b09b40e7d12ba80145df4dce000d6741fd42 100644 (file)
@@ -57,6 +57,7 @@
 #include <kernel-features.h>
 #include <inet/net-internal.h>
 #include <shlib-compat.h>
+#include <libc-diag.h>
 
 extern u_long _create_xid (void);
 
@@ -290,7 +291,17 @@ clntudp_call (/* client handle */
   int anyup;                   /* any network interface up */
 
   struct deadline_current_time current_time = __deadline_current_time ();
+  /* GCC 10 for MIPS reports total_deadline as possibly used
+     uninitialized; see
+     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91691>.  In fact it
+     is initialized conditionally and only ever used under the same
+     condition.  The same warning is also disabled in
+     inet/net-internal.h because in some other configurations GCC
+     gives the warning in an inline function.  */
+  DIAG_PUSH_NEEDS_COMMENT;
+  DIAG_IGNORE_NEEDS_COMMENT (10, "-Wmaybe-uninitialized");
   struct deadline total_deadline; /* Determined once by overall timeout.  */
+  DIAG_POP_NEEDS_COMMENT;
   struct deadline response_deadline; /* Determined anew for each query.  */
 
   /* Choose the timeout value.  For non-sending usage (xargs == NULL),