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 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.

Well, it was just the first thought.  The point is to have something that
serves as a reminder to write enough commentary.  It doesn't really matter
how much of the commentary is in an ignored string and how much is in
nearby comments.  The main thought I was having there is that something
syntactically mandatory would be more helpful than a mere policy about
having comments, in making sure we don't let something through review
absentmindedly without requiring adequate comments to justify the warning
suppression.

> > 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).

If we have cases where we really want a file verbatim from a noncooperating
elsewhere (i.e. not just gnulib or some other such place where they are
happy to insert #ifdef _LIBC stuff), then IMHO little wrapper files that
#include the verbatim file are still better than makefile-only magic
implicitly tied to the contents of the source file.

> > -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).

We can figure out what our options are in all the cases when we get around
to attempting the cleanup.


Thanks,
Roland


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