This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: -Werror policy
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 14 Nov 2014 00:33:32 +0000
- 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> <20141114001831 dot 8C7CF2C3B16 at topped-with-meat dot com>
On Thu, 13 Nov 2014, Roland McGrath wrote:
> However, I think we should probably write some internal macro using _Pragma
> that becomes the idiom rather than the whole push/pop boilerplate. We
> might even make the "mandatory comment" items be (ignored) string arguments
> to the macro, so it is quite hard to accidentally fail to supply the
> information.
I think string arguments would likely be cumbersome when you have
explanations that may be more than one line long.
> We should never use per-file -Wno-* options in makefiles. If there is a
> file-wide issue, we can just put:
> #pragma GCC diagnostic ignored "-Wfoo"
> near the top of the file (but usually after all its #include lines so it
> does not affect code from headers). In the same vein, but separate from
Not in the case of files imported verbatim from elsewhere (though I don't
know if the timezone/ files actually still need -Wno-strict-prototypes,
and -fwrapv in one case).
> -Werror issues, we should have a long-term goal of eliminating all per-file
> flags settings in favor of pragmas and/or attributes in the source files.
I'm not sure the pragmas / attributes work for things such as -fexceptions
(at least, they are only intended for specific cases such as diagnostics
and optimization options, not for completely arbitrary options).
--
Joseph S. Myers
joseph@codesourcery.com