inline

Discussion in 'C Programming' started by Andy Ploscker, Jul 22, 2012.

  1. 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
     
    Andy Ploscker, Jul 22, 2012
    #1
    1. Advertising

  2. Andy Ploscker

    Stefan Ram Guest

    Andy Ploscker <> 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.
     
    Stefan Ram, Jul 22, 2012
    #2
    1. Advertising

  3. Andy Ploscker

    Eric Sosman Guest

    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
    d
     
    Eric Sosman, Jul 22, 2012
    #3
  4. Andy Ploscker <> 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) <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"
     
    Keith Thompson, Jul 23, 2012
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Abhi
    Replies:
    2
    Views:
    750
    E. Robert Tisdale
    Jul 3, 2003
  2. Alvin
    Replies:
    7
    Views:
    487
    E. Robert Tisdale
    May 6, 2005
  3. Replies:
    3
    Views:
    471
  4. Daniel Vallstrom
    Replies:
    2
    Views:
    1,942
    Kevin Bracey
    Nov 21, 2003
  5. Nish
    Replies:
    4
    Views:
    506
    Thomas Stegen
    Oct 8, 2004
Loading...

Share This Page