This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Function level optimization

I need to perform a delay without interrupts, so I have an empty loop with just a counter.

The optimization erases the functions since it's useless, but I need it.

I don't want to turn off all the optimization of the project.

The attribute __attribute__((optimize("-Ooff")) can't be used in the TI compiler (mspgcc).

Source, page 119, 5.16.2, Function Attributes.

Any idea on how to approach this ? A #pragma maybe ?

Thanks.