-Oi: Inline Functions

Use the inline keyword or the command line option -Oi for C/C++ functions. The following listing defines a function before it is used helps the Compiler to inline it:

Listing: Example - Defining a Function


/* OK */                       /* better! */

void fun(void);                void fun(void) {

void main(void) {                // ...

   fun();                      }

}                              void main(void) {

void fun(void) {                   fun();

  // ...                       }

}

This also helps the compiler to use a relative branch instruction instead of an absolute branch instruction.