* inline vs. __inline vs. __inline__ vs. __attribute__((always_inline))
@ 2008-05-01 22:25 Yang Zhang
2008-05-01 22:39 ` Brian Dessent
0 siblings, 1 reply; 2+ messages in thread
From: Yang Zhang @ 2008-05-01 22:25 UTC (permalink / raw)
To: gcc-help
Hi, what's the difference among inline vs. __inline vs. __inline__ vs.
__attribute__((always_inline))? I couldn't find __inline or __inline__
in the documentation - are we not meant to use them? Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: inline vs. __inline vs. __inline__ vs. __attribute__((always_inline))
2008-05-01 22:25 inline vs. __inline vs. __inline__ vs. __attribute__((always_inline)) Yang Zhang
@ 2008-05-01 22:39 ` Brian Dessent
0 siblings, 0 replies; 2+ messages in thread
From: Brian Dessent @ 2008-05-01 22:39 UTC (permalink / raw)
To: Yang Zhang; +Cc: gcc-help
Yang Zhang wrote:
> Hi, what's the difference among inline vs. __inline vs. __inline__ vs.
> __attribute__((always_inline))? I couldn't find __inline or __inline__
> in the documentation - are we not meant to use them? Thanks!
The keywords with leading underscores are for when you must write ANSI
C89 compatible code:
<http://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html>. There is
no semantic difference.
The always_inline attribute forces inlining when optimization is not
enabled, where it would normally not be done:
<http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007balways_005finline_007d-function-attribute-2092>
Brian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-01 22:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-01 22:25 inline vs. __inline vs. __inline__ vs. __attribute__((always_inline)) Yang Zhang
2008-05-01 22:39 ` Brian Dessent
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).