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: [PATCH] Fix -Os related -Werror failures.


On 10/28/2016 08:55 AM, Florian Weimer wrote:
> On 10/28/2016 02:49 PM, Joseph Myers wrote:
>> On Fri, 28 Oct 2016, Florian Weimer wrote:
>> 
>>> Those who want to build with -Os or other special compiler flags
>>> should just configure with --disable-werror.  We can't account
>>> for every optimization someone might want to disable in their
>>> build.
>> 
>> I don't think --disable-werror should be encouraged.
> 
> -Wmaybe-uninitialized warnings can be issued very late from the
> optimizers, so this is very much a corner case in terms of usefulness
> for -Werror because it is practically guaranteed to have new false
> positives with unusual architectures, compiler versions, and
> optimization flags.
> 
> If the presence of this warning in particular leads people to use
> --disable-werror, maybe we should remove it from the default set of
> warnings which trigger errors.

Remove -Wmaybe-uninitialized?

That destroys some of the value of the warning and means we don't
interact with upstream gcc to make it better, either during initial
review or reviews when the gcc version gets new enough that we audit
the diagnostic.

I would rather follow Joseph's suggestion of adding optimization
specific DIAG_* macros.

e.g.
	DIAG_IGNORE_O3_NEEDS_COMMENT
	DIAG_IGNORE_O2_NEEDS_COMMENT
	DIAG_IGNORE_O1_NEEDS_COMMENT
	DIAG_IGNORE_Os_NEEDS_COMMENT
	DIAG_IGNORE_Og_NEEDS_COMMENT

Where the diagnostic is only ignored for the relevant optimization
mode.

This way the patch I just suggested would use the *_Os_* variants
and not interfere with -O2 builds. Since the kinds of warnings
generated are rather tightly coupled with the optimization passes
that are enabled, it makes sense to specialize them a bit.

-- 
Cheers,
Carlos.


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