It is currently Mon Nov 23, 2009 4:07 am




Post new topic Reply to topic  [ 2 posts ] 
 GCC Question 
Author Message
Site Admin

Joined: Sun Sep 30, 2007 8:09 pm
Posts: 404
Post GCC Question
When the compiler is fed two optimization flags in one line, which one does it take, the higher or lower? Just curious, b/c BSD ports is taking the -O2 from the makefile for KDE, and it's appending -O3 from my CFLAGS or COPTFLAGS (I can't remember which) in my make.conf.

_________________
~ LaRC President ~


Sun Jan 27, 2008 12:04 pm
Profile WWW
LaRC Regular
User avatar

Joined: Mon Oct 01, 2007 10:05 pm
Posts: 72
Location: Cygnus X-1
Post Re: GCC Question
I believe I may have already talked with you about this, but in the spirit of being more active on the forums, here it goes.

It would be logical, in context of how arguments are generally parsed in UNIX tools, that whatever option appears last is that which will be used. For example:

Code:
gcc -03 -0s micro.c -o micro


That should generate a binary with size optimization, not level 3.

_________________
lain_proliant
Laboratory for Recreational Computing
Secretary


Sat Feb 16, 2008 4:45 am
Profile WWW
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.