This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Don't use -Wno-uninitialized in math/
- From: Stan Shebs <stanshebs at google dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Thu, 20 Aug 2015 16:25:01 -0500
- Subject: Re: Don't use -Wno-uninitialized in math/
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1508201800380 dot 30940 at digraph dot polyomino dot org dot uk> <CA+5-Q5Kqy50Ar1KLPfV9WuAfzhDTY7qNYgsJCT1Oxizj9wnphg at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1508202043180 dot 994 at digraph dot polyomino dot org dot uk>
On Thu, Aug 20, 2015 at 3:47 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Thu, 20 Aug 2015, Stan Shebs wrote:
>
>> On Thu, Aug 20, 2015 at 1:00 PM, Joseph Myers <joseph@codesourcery.com> wrote:
>> > The uninitialized variable warnings in math/ having been fixed for all
>> > the supported floating-point formats, this patch removes the use of
>> > -Wno-uninitialized there, continuing with the goal of avoiding -Wno-
>> > options in makefiles as far as possible..
>>
>> Not sure how you didn't see this, but my fresh build fails with this
>> (GCC 4.8.4, Ubuntu 14.04, vanilla configure):
>
> I'm testing with GCC 5. Maybe newer GCC detects that sign is set under
> one "absx >= 0.6743316650390625L" conditional and used under the next such
> conditional, so is never actually used uninitialized, but older GCC
> doesn't detect that the conditionals are the same?
>
> Anyway, since you're testing with the compiler with which this fails, I
> advise submitting a patch that uses the DIAG_* macros from libc-internal.h
> to suppress the warning around the specific code that gets the warning,
> with a comment explaining why it's a false positive and with 4.8 named as
> the version in the call to DIAG_IGNORE_NEEDS_COMMENT. (Remember that when
> disabling -Wmaybe-uninitialized, you need to disable -Wuninitialized
> instead if !__GNUC_PREREQ (4, 7), as 4.6 doesn't have
> -Wmaybe-uninitialized.)
Yes, that works, thanks! I notice that there are several pre-existing
instances of this pattern, but some list 4.9 and others list 5 as the
version - does anybody know if there is a canonical minimal GCC
version for the better uninitialized warning, or is it just whatever
was getting tested at the time?
Stan