This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] soft-fp: ignore maybe-uninitialized
On Wed, 19 Sep 2018, Martin Jansa wrote:
> diff --git a/soft-fp/op-2.h b/soft-fp/op-2.h
> index 6020d663d4..6672337949 100644
> --- a/soft-fp/op-2.h
> +++ b/soft-fp/op-2.h
> @@ -92,6 +92,8 @@
> X##_f1 = 0; \
> }))
>
> +#pragma GCC diagnostic push
> +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
As soft-fp is shared with libgcc, it can't use the DIAG_* macros from
libc-diag.h. *But* the principle of needing detailed comments to justify
any warning suppression remains. Those comments would need to identify
the warning in question, and why it is a false positive, and the most
recent compiler version known to produce that false positive, and the
suppression should probably be conditional on building with -O if it isn't
needed with -O2 / -Os.
Rather than putting the suppression around a macro definition, I wonder
about putting it at the place where the macros are used (s_fdiv.c, it
appears from the warnings you quote). That's what we do for the soft-fp
implementations of fma, for example, and it would allow you to use the
DIAG_* macros. You'd need to add DIAG_IGNORE_O1_NEEDS_COMMENT like
DIAG_IGNORE_Os_NEEDS_COMMENT to libc-diag.h, and then use it with an
appropriate comment in s_fdiv.c (explaining the warning and why it is a
false positive).
--
Joseph S. Myers
joseph@codesourcery.com