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/20/2015 06:59 AM, Carlos O'Donell wrote:
On 07/20/2015 03:20 AM, Mike Frysinger wrote:
On 17 Jul 2015 11:36, Andreas Schwab wrote:
Mike Frysinger <vapier@gentoo.org> writes:
we have __attribute_used__ ...

That's actually obsolete now that we require gcc >= 4.6.

right, for internal source files.  __attribute_used__ is kept around though for
public headers since we don't require newer gcc versions to build against glibc.
which leads to me forgetting and always using the defines both in internal and
in public code (better than forgetting and never using the defines even in the
public headers?).
-mike

Yes it is better :-)

We should make our internal headers cause a warning to be emitted if you use
obsolete attributes given the newly required gcc to build glibc, but we haven't
gotten around to it.

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?

FWIW: I chose __attribute__((used)) based on its prevalent
number of occurrences in GLIBC .c and .h files: I counted
322 instances of it, versus only 17 of __attribute_used__.
I have no problem changing it to __attribute_used__ for
this patch, and I would also be happy to submit a followup
patch to replace existing occurrences of __attribute__
((used)) with __attribute_used__ if that's viewed as useful
(I can see how having the same name expand to the appropriate
attribute given the GCC version used to compile each file,
either internal to GLIBC or public, would simplify its use).

Martin


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