Author Topic: How to set the O0 compiler option?  (Read 4457 times)

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
How to set the O0 compiler option?
« on: August 21, 2018, 07:09:50 pm »
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:
Quote
Using -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?
« Last Edit: August 21, 2018, 07:12:12 pm by spflanze »

Offline blauzahn

  • Almost regular
  • **
  • Posts: 156
Re: How to set the O0 compiler option?
« Reply #1 on: August 21, 2018, 08:28:47 pm »
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.
« Last Edit: August 21, 2018, 08:35:09 pm by blauzahn »

Offline raynebc

  • Almost regular
  • **
  • Posts: 217
Re: How to set the O0 compiler option?
« Reply #2 on: August 22, 2018, 12:59:02 am »
Isn't no optimization the default as long as you don't enable any optimization flags?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
Re: How to set the O0 compiler option?
« Reply #3 on: August 22, 2018, 01:21:22 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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org