|
|
||||
|
||||
|
|
|
|||
|
Andy Ploscker <nospam@nospam.com> writes:
>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. |
|
|||
|
On 7/22/2012 5:46 PM, Andy Ploscker wrote:
> 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. -- Eric Sosman esosman@ieee-dot-org.invalid |
|
|||
|
Andy Ploscker <nospam@nospam.com> writes:
> 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. -- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> Will write code for food. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister" |
|
|||
|
On Sun, 22 Jul 2012 17:11:44 -0700, Keith Thompson <kst-u@mib.org>
wrote: >Andy Ploscker <nospam@nospam.com> writes: >> 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. I'm pretty sure they made that statement too recently to have made it policy for the VS2010 release, and MS has a policy of not changing the language between major VS releases. FWIW, MSVC does support "__inline" in that role. |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|