This is the mail archive of the libc-alpha@sourceware.org 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]

Re: -Werror policy


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


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