Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-29-2006, 03:04 AM   #1
Registered: Oct 2003
Posts: 354

Rep: Reputation: 30
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,
Old 08-29-2006, 03:40 AM   #2
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
Did you try the manpages?
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:
-O0 Do not optimize.  This is the default.
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.
Old 08-29-2006, 02:52 PM   #3
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 42
He probably didn't find it because he was searching for -00, not -O0. understandable.
Old 08-29-2006, 03:28 PM   #4
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc unrecognized option ruben22 Linux From Scratch 9 11-12-2008 04:41 AM
gcc -I option vkmgeek Programming 18 05-16-2006 06:27 PM
question about gcc/g++ -M option George2 Programming 4 04-27-2006 10:02 PM
what does the option -s of gcc mean ? hongxing Linux - Software 3 11-28-2005 08:12 PM
gcc option -E use. niverson Programming 2 10-11-2004 04:06 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:36 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration