Different combinations of extern
and inline
and no function specifiers may be valid and will compile, yet the behaviour may be different.
Whether a function will actually be inlined is defined by these two paragraphs of the C99-standard (cf, for example, this online C99 standard draft):
6.7.4 Function specifiers
...
(6) A function declared with an inline function specifier is an inline
function. Making a function an inline function suggests that calls to
the function be as fast as possible.138) The extent to which such
suggestions are effective is implementation-defined.139)
(7) Any function with internal linkage can be an inline function. For a
function with external linkage, the following restrictions apply: If a
function is declared with an inline function specifier, then it shall
also be defined in the same translation unit. If all of the file scope
declarations for a function in a translation unit include the inline
function specifier without extern, then the definition in that
translation unit is an inline definition. An inline definition does
not provide an external definition for the function, and does not
forbid an external definition in another translation unit. An inline
definition provides an alternative to an external definition, which a
translator may use to implement any call to the function in the same
translation unit. It is unspecified whether a call to the function
uses the inline definition or the external definition.140)
Paragraph (6) defines that - even if a function is an "inline function" - it is implementation defined whether it is actually "inlined" or not.
Paragraph (7) says that only if all the declarations of a file-scope function identifier are marked as inline
and none of them is marked as external
, then the function is defined inline.
In your example, since you do not use an external
keyword, the function will be defined as inline. If it is actually inlined is, according to paragraph (6), still implementation defined.