This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Status of undef warnings fix?
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Will Newton <will dot newton at linaro dot org>, Steve Ellcey <sellcey at mips dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Mon, 28 Apr 2014 12:55:13 -0400
- Subject: Re: Status of undef warnings fix?
- Authentication-results: sourceware.org; auth=none
- References: <9209b361-a6db-4dce-87df-630635a01a47 at BAMAIL02 dot ba dot imgtec dot org> <CANu=DmhRfotiun_AF0UarPr07BkSh84DiPvEjD5MjwvYUqW8GA at mail dot gmail dot com> <1398457515 dot 26375 dot 11 dot camel at ubuntu-sellcey> <CANu=Dmg7d_4mu2e663qx0VBUNt9GyfQ6eFZtw6ahGN5cxZHN6w at mail dot gmail dot com>
On 04/28/2014 03:24 AM, Will Newton wrote:
> On 25 April 2014 21:25, Steve Ellcey <sellcey@mips.com> wrote:
>> On Fri, 2014-04-25 at 20:06 +0100, Will Newton wrote:
>>> On 25 April 2014 19:03, Steve Ellcey <sellcey@mips.com> wrote:
>>>>
>>>> I was wondering what the status of the patches to fix the various
>>>> undef warnings in the glibc build was. I.e.:
>>>>
>>>> ../sysdeps/generic/ldsodefs.h:536:24: warning: "HP_SMALL_TIMING_AVAIL" is not defined [-Wundef]
>>>>
>>>> I am getting 1665 of them during one build of glibc.
>>>>
>>>> I see a set of patches that were submitted last month by Will Newton,
>>>> https://sourceware.org/ml/libc-alpha/2014-03/msg00476.html for
>>>> example. But it doesn't look like they have been checked in yet.
>>>
>>> I reverted the patches as they were not the correct approach.
>>> Unfortunately for the majority of the warnings nobody has stepped up
>>> to implement the correct approach.
>>
>> Do you have a pointer to what is considered 'the correct approach'. I
>> tried reading through the email to find it but got lost in a maze of
>> twisty replies.
>
> My understanding is we want to use #if rather than #ifdef as far as
> possible so if someone typos a #define then the #if will cause a
> compile time warning rather than silently being treated as undefined.
>
> This means that rather than having a preprocessor symbol defined or
> not defined by an architecture to enable a feature the symbol should
> be defined to either 1 or 0 in every architecture. So to fix some of
> these warnings correctly involves cross-architecture patches and
> knowledge of how sysdeps works which I think partly explains why they
> are taking so long to fix.
I'm working to try fix some of these warnings, but it's slow progress.
They are indeed hard to fix in some cases.
Cheers,
Carlos.