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 #19444 - build failures with -O1 due to -Wmaybe-uninitialized


On 13 Jan 2016 10:02, Martin Sebor wrote:
> In his comments on the bug, Carlos suggests to fix these instances
> of false positives and to get -O1 to work.  The attached patch
> does just that.  In the patch, to minimize the impact of the
> (otherwise unnecessary) initialization, rather than initializing
> them for all the code paths, I reduced the scope of the local
> variables that are subject to the warning and added the redundant
> initialization only for the problem code paths.  This led to more
> changes that would otherwise be required but resulted in code
> that's easier to follow.

any time code is changed to address warnings, especially "harmless" ones,
the first question is "has the compiled output changed".  if gcc produces
worse code at -O2, then this is probably not the right direction.

> The patch also adds -Wno-error=maybe-uninitialized to the warning
> options when -O1 or lower is set in CFLAGS to prevent these false
> positives from causing build failures.  This change renders the
> changes above strictly unnecessary.  I include both since I think
> both are worthwhile but I can remove one or the other if others
> have a different preference.

i'm in favor of this myself.  we clearly do not test -O1 as the normal
course of things, so it'll be perpetually broken.
-mike

Attachment: signature.asc
Description: Digital signature


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