This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: -Werror policy
- From: Florian Weimer <fweimer at redhat dot com>
- To: Joseph Myers <joseph at codesourcery dot com>, libc-alpha at sourceware dot org
- Date: Fri, 14 Nov 2014 19:27:13 +0100
- Subject: Re: -Werror policy
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1411132331520 dot 5050 at digraph dot polyomino dot org dot uk>
On 11/14/2014 12:43 AM, Joseph Myers wrote:
* If a particular warning seems hard to fix (including hard-to-fix false
positives), use
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfoo"
#pragma GCC diagnostic pop
around the code generating the warning, with a comment stating the warning
and a GCC version / architecture for which it was observed. (In files
shared with gnulib, these pragma calls would need to be conditional.)
It's certainly better to use the pragmas then to massage the code until
the warning goes away, but I'm a bit hesitant to clutter the source code
with hat are essentially workarounds for compiler bugs.
There's also the issue of warnings issued from fold and the optimizers,
which are rather architecture-specific. This means that port
maintainers will face some -Werror fallout.
--
Florian Weimer / Red Hat Product Security