News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

How to set the O0 compiler option?

Started by spflanze, August 21, 2018, 07:09:50 PM

Previous topic - Next topic

spflanze

I am using Valgrind to find the cause of a Segmentation Fault. On this webpage: http://valgrind.org/docs/manual/quick-start.html I see:
QuoteUsing -O0 is also a good idea, if you can tolerate the slowdown.
In Code:Blocks Settings => Compiler I see optimization flags for -O, -O1, -O2, -O3, and -Os . But I do not see -O0. How can the -O0 compiler option be put into effect?

blauzahn

#1
you can add it under "other compiler options".

I recommend to set these within the project's compiler settings instead of the general ones unless
you want to apply them to all your projects.

raynebc

Isn't no optimization the default as long as you don't enable any optimization flags?

stahta01

Quote from: raynebc on August 22, 2018, 12:59:02 AM
Isn't no optimization the default as long as you don't enable any optimization flags?

It depends on what the default is for the compiler.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]