title: C++ inline functions using GCC - why the CALL?
body: <p>I have been testing inline function calls in C++.</p>
  
  <pre><code>Thread model: win32
  gcc version 4.3.3 (4.3.3-tdm-1 mingw32)
  </code></pre>
  
  <p>Stroustrup in The C++ Programming language wirtes:</p>
  
  <blockquote>
    <p>The inline specifier is a hint to the compiler that it should attempt to generate code [...] inline rather than laying down the code for the function once and then calling through the usual function call mechanism.</p>
  </blockquote>
  
  <p>However, I have found out that the generated code is simply not inline. There is a <em>CALL</em> instrction for the <strong>isquare</strong> function.</p>
  
  <p><a href="https://i.stack.imgur.com/LbyAx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LbyAx.jpg" alt="alt text"></a>
  </p>
  
  <p><strong>Why is this happening? How can I use inline functions then?</strong></p>
  
  <p><strong>EDIT:</strong> The command line options used:</p>
  
  <pre><code>**** Build of configuration Debug for project InlineCpp ****
  
  **** Internal Builder is used for build               ****
  g++ -O0 -g3 -Wall -c -fmessage-length=0 -osrc\InlineCpp.o ..\src\InlineCpp.cpp
  g++ -oInlineCpp.exe src\InlineCpp.o
  </code></pre>