Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7742

SDK • Re: How remove ALL compiler optimization in debug mode

$
0
0
You can use custom optimization at function level using attribute:

Code:

void __attribute__((optimize("O3"))) fast_function(void) {    // ...}

Or at function/file level using pragma:

Code:

#pragma GCC push_options#pragma GCC optimize ("O3")/* * Code that needs optimizing */#pragma GCC pop_options
https://interrupt.memfault.com/blog/cod ... -gcc-flags

In your case it would be "O0": https://gcc.gnu.org/onlinedocs/gcc/Opti ... tions.html

6.4.1 Common Attributes: https://gcc.gnu.org/onlinedocs/gcc/Comm ... x-optimize
6.5.15 Function Specific Option Pragmas: https://gcc.gnu.org/onlinedocs/gcc/Func ... agmas.html

Statistics: Posted by gmx — Tue May 12, 2026 11:48 pm



Viewing all articles
Browse latest Browse all 7742

Latest Images

Trending Articles



Latest Images