__gnu_inline__ and __artificial__

Marek Polacek mmpolacek@gmail.com
Fri Jul 30 12:22:00 GMT 2010


  On 07/30/2010 09:07 AM, Nikolai Lazarov wrote:
> Please, can you explain what exactly these two attributes do?
>
>
>
Semantics for 'inline' in ISO C99 and GNU90 differs.

If you're compiling with -std=gnu99 but want the GNU90 semantics, you 
would use
__attribute__ ((gnu_inline)) inline int func() { return 0; }

This is exactly the same like this compiled with -std=gnu89:
inline int func() { return 0; }

GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 inline 
semantics, unless -fgnu89-inline is used.

About artificial, well, I'd be also interested.

Thanks,
Marek



More information about the Gcc-help mailing list