This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: fix build errors with -DNDEBUG
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Martin Sebor <msebor at gmail dot com>, Joseph Myers <joseph at codesourcery dot com>
- Cc: Andreas Schwab <schwab at linux-m68k dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 24 Jul 2015 15:18:50 -0400
- Subject: Re: fix build errors with -DNDEBUG
- Authentication-results: sourceware.org; auth=none
- References: <55A83361 dot 6010506 at gmail dot com> <20150717020539 dot GF5641 at vapier> <87pp3r9lco dot fsf at igel dot home> <20150720072047 dot GO5641 at vapier> <55ACF099 dot 4050301 at redhat dot com> <55ADBEEE dot 6030401 at gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1507221717340 dot 21570 at digraph dot polyomino dot org dot uk> <55AFD628 dot 2020000 at gmail dot com>
On 07/22/2015 01:43 PM, Martin Sebor wrote:
> On 07/22/2015 11:18 AM, Joseph Myers wrote:
>> On Mon, 20 Jul 2015, Martin Sebor wrote:
>>
>>> I'm not sure what guidance to take from this discussion.
>>> Is the request to replace __attribute__ ((unused)) with
>>> __attribute_used__ in this patch or is it okay to commit
>>> as is?
>>
>> "used" and "unused" are different attributes and should not be confused.
>
> Yes, thank you. I misread the definition of __attribute_used__
> macro. Based on its definition in misc/sys/cdefs.h (copied
> below) it expands to attribute used for recent GCC and attribute
> UNused for old GCC.
>
> So changing the patch to use __attribute_used__ wouldn't make
> sense.
>
> Given that, are there any objections to the patch?
>
> /* At some point during the gcc 3.1 development the `used' attribute
> for functions was introduced. We don't want to use it unconditionally
> (although this would be possible) since it generates warnings. */
> #if __GNUC_PREREQ (3,1)
> # define __attribute_used__ __attribute__ ((__used__))
> # define __attribute_noinline__ __attribute__ ((__noinline__))
> #else
> # define __attribute_used__ __attribute__ ((__unused__))
> # define __attribute_noinline__ /* Ignore */
> #endif
Please don't check this in for 2.22.
Please restart this discussion with a new thread when 2.23 opens.
I think each of these cases you cover needs to be reviewed independently
and fixed correctly.
Cheers,
Carlos.