This is the mail archive of the
mailing list for the glibc project.
Re: fix build errors with -DNDEBUG
- From: Martin Sebor <msebor at gmail dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Carlos O'Donell <carlos at redhat dot com>, Andreas Schwab <schwab at linux-m68k dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 22 Jul 2015 11:43:04 -0600
- 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>
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
"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
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__))
# define __attribute_used__ __attribute__ ((__unused__))
# define __attribute_noinline__ /* Ignore */