LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   about -00 option of gcc (https://www.linuxquestions.org/questions/programming-9/about-00-option-of-gcc-478345/)

George2 08-29-2006 03:04 AM

about -00 option of gcc
 
Hello everyone,


What is the function of -00 option in gcc? I can not find related descriptions from gcc manual.


thanks in advance,
George

zhangmaike 08-29-2006 03:40 AM

Did you try the manpages?
Code:

man gcc
Depending on what pager is used on your system (on mine, it's "less"), you can often search the manpage that you're viewing by typing a / followed by the string you wish to search for.

The / key for searching is VERY common... it's used in less, vim, lynx, and many other command line tools. After performing at least one search, just typing / followed by enter finds the next occurence.

Typing /-O0 and pressing enter and repeating the search as necessary would eventually lead you to the following:
Code:

-O0 Do not optimize.  This is the default.
Quote:

I can not find related descriptions from gcc manual.
Spend a few more minutes searching. Google is your friend, and the description of this option and all others is easily locatable in the gcc manpage and in the online gcc manual at the gcc site. Look in the section about command line options, and in the subsection about optimization options.

aluser 08-29-2006 02:52 PM

He probably didn't find it because he was searching for -00, not -O0. understandable.

paulsm4 08-29-2006 03:28 PM

gcc -O0: disable optimizations
 
Hi -

The "-O0" turns optimizations OFF.

You would do this if you want to make sure the code you're executing matches (as closely as possible) the code you actually wrote (without the compiler "second guessing" you).

For this reason, compiling with "-g" (debug) usually implicitly sets "-O0" (so the code you're debugging matches the executable).

And yes, "man" is definitely your friend!


All times are GMT -5. The time now is 11:50 AM.