This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fix build errors with -DNDEBUG


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

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]