inline

A

Andy Ploscker

I'm working on a project in C after a break.

A colleague tells me there's been a recent revision of ANSI C, and
"inline" functions have now been standardized. Can anyone confirm this,
and comment on vendor uptake so far?

Regards,
Andy
 
S

Stefan Ram

Andy Ploscker said:
A colleague tells me there's been a recent revision of ANSI C, and
"inline" functions have now been standardized. Can anyone confirm this,
and comment on vendor uptake so far?

Depends on your definition of »"inline" functions. Are these
functions tagged with the keyword »inline«, whatever that
might mean, or rather functions that are marked to be inlined?

The keyword »inline« is part of ISO C since not after 1999.
Making a function an »inline« function suggests that calls
to the function be as fast as possible (that does not
necessarily mean that they have to be inlined!). The extent
to which such suggestions are effective is implementation-defined.

An inline function must be defined in the compilation unit
it is declared in, it does not provide an external
definition, that might be provided in addition as an
alternative. - The vendor has to implement this behavior,
but does not need to inline the code generated.
 
E

Eric Sosman

I'm working on a project in C after a break.

A colleague tells me there's been a recent revision of ANSI C, and
"inline" functions have now been standardized. Can anyone confirm this,
and comment on vendor uptake so far?

The recent revision to "ANSI C" is formally known as
ISO/IEC 9899:2011, but is usually known by its less formal
nickname "C11." It was adopted by ISO in December of last
year.

However, C11 did not introduce an `inline' keyword. That
was the work of ISO/IEC 9899:1999, "C99" to its friends. ISO
published C99 in 1999 (duh), and ANSI adopted it in 2000. So,
`inline' has been part of the language since the Clinton
Administration.

Vendor uptake of C99 was laggardly, but most implementations
support much of it nowadays. Wikipedia has a list of some, with
indications of how complete their C99 support is.
 
K

Keith Thompson

Andy Ploscker said:
I'm working on a project in C after a break.

A colleague tells me there's been a recent revision of ANSI C, and
"inline" functions have now been standardized. Can anyone confirm this,
and comment on vendor uptake so far?

Yes, inline functions were standardized by the 1999 ISO C standard,
and many compilers that don't fully support the C99 standard have
supported "inline" as an extension.

Unfortunately, Microsoft has not expressed much interest in
supporting C99, and a quick experiment indicates that Visual Studio
2010 doesn't recognize "inline" in C mode (even with language
extensions enabled). This is a little surprising, since they've
said that they intend to support those features of C99 (and C11)
that are also in C++, which "inline" certainly is.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top