Hello,
I use Cube IDE, I would like to insert directives for the compiler into the code, for different optimization of parts of the code. How to do it?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-28 1:24 AM
This discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION
Accepted Solutions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-29 4:23 AM
The underlying compiler is gcc, so check the docs https://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html.
Basically, something like
#pragma GCC push_options
#pragma GCC optimize ("O0")
void my_function() {
...
}
#pragma GCC pop_options
will do the trick
hth
KnarfB
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-29 4:23 AM
The underlying compiler is gcc, so check the docs https://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html.
Basically, something like
#pragma GCC push_options
#pragma GCC optimize ("O0")
void my_function() {
...
}
#pragma GCC pop_options
will do the trick
hth
KnarfB
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-29 10:39 AM
Thanks a lot :grinning_face:
