title: Keil ARM C compiler: troubles with inline functions
body: <p>I'm porting the real-time kernel <a href="http://goo.gl/cc5MSM" rel="nofollow">TNeoKernel</a> to the Cortex-M architecture, so I've installed Keil and am trying to build the kernel. However, I'm facing unexpected issues: the compiler seems not being able to handle <code>inline</code> functions. Here's simple code:</p>
  
  <pre><code>static inline int test(void)
  {
     return 0;
  }
  </code></pre>
  
  <p>Compiler's output is as follows:</p>
  
  
  
  <pre><code>src\appl\main.c(17): warning:  #260-D: explicit type is missing ("int" assumed)
    static inline int test(void)
  src\appl\main.c(17): error:  #65: expected a ";"
    static inline int test(void)
  </code></pre>
  
  <p>If I remove the <code>inline</code> keyword, it compiles and works.</p>
  
  <p>In the documentation of ARM Compiler I can't find anything about <code>inline</code> functions. So, just to make sure: is the <code>inline</code> keyword really not supported by the ARM Compiler? It is too unbelievable so I decided to ask.</p>
  
  <p>I have many <code>static inline</code> functions in the kernel's platform-independent code, so, what is the best way to make it support ARM compiler? Off the top of my head, I have just two ideas:</p>
  
  <ul>
  <li>create architecture-dependent macro like <code>TN_INLINE</code>, and for ARM compiler it should expand to nothing;</li>
  <li>convert really small 1-line functions to macros.</li>
  </ul>