A note on inline definitions ...

Just a short note -

In reviewing the entries in the Sun Developer Forum from this past week, I was
reminded of a "gotcha" that became a "gotcha" with the implementation of
support for the "inline" keyword as defined in the C99 standard. Fedor's
response to the original question:

See this entry the Sun Developer Forum

It covers all the bases, but one thing that might be good to highlight again is
the interesting little thing called an "inline definition". Many are under the
mistaken impression that this simply means to inline the given function.
However, as noted by Fedor in the Sun Forum, an "inline definition" (a
function defined with the inline keyword, with all other file scope
declarations using the inline keyword without extern) is a case that isn't
necessarily intuitive. Remember, they do not provide an
external definition for the function.  Any function call appearing in the
source file containing an inline definition will either be satisfied by
inlining the  function definition at the call site (only at -xO3 or above,
and if deemed profitable by the optimizer), or by a reference  to an externally
defined function.
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

dpagan

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today