This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Disable -Wmaybe-uninitialized for total_deadline in sunrpc/clnt_udp.c [committed]

To work around <>
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 (compilers and glibcs stages) for
mips64-linux-gnu with GCC mainline.

2019-10-02  Joseph Myers  <>

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

diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c
index c2436e3ebc..ee79b09b40 100644
--- a/sunrpc/clnt_udp.c
+++ b/sunrpc/clnt_udp.c
@@ -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
+     <>.  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_IGNORE_NEEDS_COMMENT (10, "-Wmaybe-uninitialized");
   struct deadline total_deadline; /* Determined once by overall timeout.  */
   struct deadline response_deadline; /* Determined anew for each query.  */
   /* Choose the timeout value.  For non-sending usage (xargs == NULL),

Joseph S. Myers

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]