Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.c

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 07-22-2012, 09:46 PM
Andy Ploscker
Guest
 
Posts: n/a
Default inline

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
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 07-22-2012, 10:08 PM
Stefan Ram
Guest
 
Posts: n/a
Default Re: inline

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.

Reply With Quote
  #3 (permalink)  
Old 07-22-2012, 10:23 PM
Eric Sosman
Guest
 
Posts: n/a
Default Re: inline

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
Reply With Quote
  #4 (permalink)  
Old 07-23-2012, 12:11 AM
Keith Thompson
Guest
 
Posts: n/a
Default Re: inline

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"
Reply With Quote
  #5 (permalink)  
Old 07-23-2012, 03:45 AM
Robert Wessel
Guest
 
Posts: n/a
Default Re: inline

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.
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 10:43 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.