This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: pragma change breaks build
- From: David Miller <davem at davemloft dot net>
- To: joseph at codesourcery dot com
- Cc: libc-alpha at sourceware dot org, eggert at cs dot ucla dot edu
- Date: Mon, 27 Apr 2015 13:27:00 -0400 (EDT)
- Subject: Re: pragma change breaks build
- Authentication-results: sourceware.org; auth=none
- References: <20150427 dot 123657 dot 10432164616133021 dot davem at davemloft dot net> <alpine dot DEB dot 2 dot 10 dot 1504271712090 dot 17788 at digraph dot polyomino dot org dot uk>
From: Joseph Myers <joseph@codesourcery.com>
Date: Mon, 27 Apr 2015 17:14:52 +0000
> On Mon, 27 Apr 2015, David Miller wrote:
>
>>
>> This change:
>>
>> 2015-04-19 Paul Eggert <eggert@cs.ucla.edu>
>>
>> * stdlib/setenv.c (__add_to_environ):
>> Dump core quickly if setenv (..., NULL, ...) is called.
>> This time, do it the right way, and pacify GCC with a pragma.
>>
>> Breaks, rather than fixes, the build for me. I don't think we can
>> universally assume that this pragma facility is available:
>>
>> setenv.c:27:9: error: unknown option after ʽ#pragma GCC diagnosticʼ kind [-Werror=pragmas]
>> setenv.c:27:9: error: unknown option after ʽ#pragma GCC diagnosticʼ kind [-Werror=pragmas]
>
> The issue here is -Wmaybe-uninitialized not being supported by older GCC.
> That is, if the warnings appear with 4.6, a conditional call using
> -Wuninitialized instead is needed (and otherwise, condition it on
> __GNUC_PREREQ (4, 7) as in resolv/res_send.c).
It is quite surprising how much effort is being put into pacifying the
compiler in one way or another in this file.
For example, instead of just adding a "= 0" initializer to vallen so
that all gcc's will not warn, we add various contortions and a huge
comment explaining the situation.
This pragma thing is just the icing on the cake.
I guess some people want to fight the compiler all day, but the rest of
us here just simply want the tree to build so we can get work done.
This warning situation is very tiring.... it's been strongly
detrimental to my ability to contribute to glibc in any meaningful way
over the past year or so.