bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fwrite: silence __wur without using inline


From: Paul Eggert
Subject: Re: [PATCH] fwrite: silence __wur without using inline
Date: Thu, 03 Jan 2013 12:48:05 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 01/03/13 12:23, Eric Blake wrote:

> The elided code was not using _GL_EXTERN_INLINE, but _GL_INLINE.  They
> have different semantics, but I'm hard-pressed to say _which_ semantics
> are right from just those names.

Standard C semantics.  _GL_EXTERN_INLINE is C99/C11 extern inline.
_GL_INILNE is C99/C11 inline.

> If I understand correctly, we _want_
> the semantics where the inline function is _always_ inlined and never
> emitted as a linkable entry point, but I'd have to refer back to C99 and
> the gcc manual to see which use of inline and possible __attribute__
> combinations guarantees that point.

Can't be done in Standard C, as far as I know.
With GNU C it can be done with __attribute__((__always_inline__)).

Why is it important that it not be a linkable entry point?

> maybe it's worth adding a name _GL_ELIDABLE_INLINE into
> m4/extern-inline.m4 to make it easier to use the results.

Sorry, I guess I don't see how this would work.
That is, I can see how _GL_ELIDABLE_INLINE would expand to 
'inline __attribute__((__always_inline__))'
in GNU C, but what would it expand to in Standard C?
It can't be expanded to nothing, since you don't want
a linkable entry point, and it can't be expanded to 'static',
at least not in a header, because the resulting function
couldn't be called from an extern inline function.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]