[PATCH] Use __gnu_inline__ for __extern_always_inline in g++-4.2

Richard Smith richard@metafoo.co.uk
Tue Jan 8 21:29:00 GMT 2013


Updated patch attached.

On Mon, Jan 7, 2013 at 11:02 PM, Paul Eggert <eggert@cs.ucla.edu> wrote:
> On 01/07/2013 09:04 PM, Richard Smith wrote:
>
>> Index: include/sys/cdefs.h
>
> Shouldn't that be misc/sys/cdefs.h in the glibc source?

Thanks, attached patch is produced by git diff against the glibc sources.

>> +# if defined __GNUC_STDC_INLINE__ || \
>> +    (defined __cplusplus && defined __GNUC_GNU_INLINE__)
>
> Shouldn't that be "#ifdef __GNUC_GNU_INLINE__"?

No -- in C++, __GNUC_GNU_INLINE__ is defined, even though __inline
does not use the GNU C inline semantics. I've added an explanatory
comment in the revised patch. I also simplified this test slightly by
removing the `defined __cplusplus' check -- it will now use the
__gnu_inline__ attribute whenever it exists, rather than just when it
exists and is not the default, which I hope will avoid future
confusion here.

On Tue, Jan 8, 2013 at 1:10 AM, Andreas Schwab <schwab@suse.de> wrote:
> Richard Smith <richard@metafoo.co.uk> writes:
>
>> +# if defined __GNUC_STDC_INLINE__ || \
>> +    (defined __cplusplus && defined __GNUC_GNU_INLINE__)
>
> Line break before operator, not after.

Thanks, new revision of the patch needs no line break.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extern-always-inline-gnu-inline-2.diff
Type: application/octet-stream
Size: 1241 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20130108/f89fd450/attachment.obj>


More information about the Libc-alpha mailing list