This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Don't use -Wno-uninitialized in math/
- From: Andreas Schwab <schwab at suse dot de>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Mon, 24 Aug 2015 16:09:06 +0200
- Subject: Re: Don't use -Wno-uninitialized in math/
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1508201800380 dot 30940 at digraph dot polyomino dot org dot uk> <mvma8th7zw6 dot fsf at hawking dot suse dot de> <alpine dot DEB dot 2 dot 10 dot 1508241123090 dot 13809 at digraph dot polyomino dot org dot uk>
Joseph Myers <joseph@codesourcery.com> writes:
> Does putting the DIAG_* macros (with appropriate comments) in the relevant
> inline functions (possibly libc_feresetround_aarch64_ctx or
> libc_feresetround_noex_aarch64_ctx) help?
This works:
* sysdeps/aarch64/fpu/math_private.h
(libc_feresetround_aarch64_ctx): Suppress maybe-uninitialized
warning.
---
sysdeps/aarch64/fpu/math_private.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/sysdeps/aarch64/fpu/math_private.h b/sysdeps/aarch64/fpu/math_private.h
index 1f02ddb..28c4497 100644
--- a/sysdeps/aarch64/fpu/math_private.h
+++ b/sysdeps/aarch64/fpu/math_private.h
@@ -21,6 +21,7 @@
#include <fenv.h>
#include <fpu_control.h>
+#include <libc-internal.h>
#define math_opt_barrier(x) \
({ __typeof (x) __x = (x); __asm ("" : "+w" (__x)); __x; })
@@ -274,7 +275,15 @@ libc_feresetround_aarch64_ctx (struct rm_ctx *ctx)
{
/* Restore the rounding mode if updated. */
if (__glibc_unlikely (ctx->updated_status))
- _FPU_SETCW (ctx->env.__fpcr);
+ {
+ /* The initialisation of ctx->env.__fpcr in
+ libc_feholdsetround_aarch64_ctx is guarded by the same condition,
+ but GCC doesn't see that. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
+ _FPU_SETCW (ctx->env.__fpcr);
+ DIAG_POP_NEEDS_COMMENT;
+ }
}
#define libc_feresetround_ctx libc_feresetround_aarch64_ctx
--
2.5.0
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."