LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-13-2010, 02:27 PM   #1
Ajit Gunge
Member
 
Registered: Jan 2008
Location: Pune
Distribution: RHEL,fedora
Posts: 253
Blog Entries: 1

Rep: Reputation: 21
Regarding compiling a program with different options


I am suing RHEL.I have a small C/Cpp program and I am trying the possible combinations during compilations that I can use.I want to see the output of all the options I am trying to redirect this output in a file but I dont get to see the output in the file.This is what I am trying to do

My c program is named as prog4.cpp

Quote:
#include<iostream>
static int Code;
int code2;
int main (void)
{
printf("Value is %d",Code);
printf("Value is %d",code2);
return 0;
}
now I am compiling this program with multiple options of g++ such as -Wall,-fno-inline etc etc I want to see the individual output for these options but I cannot see it in the file that I am redirecting the output to.Can someone help?

Thanks Regards,
Ajit
 
Old 04-13-2010, 02:39 PM   #2
Ajit Gunge
Member
 
Registered: Jan 2008
Location: Pune
Distribution: RHEL,fedora
Posts: 253
Blog Entries: 1

Original Poster
Rep: Reputation: 21
Sorry the word is using and not suing
 
Old 04-13-2010, 02:42 PM   #3
modprob
Member
 
Registered: Jul 2009
Location: Montreal
Distribution: Slackware
Posts: 35

Rep: Reputation: 17
It's not possible to see the effects of those options in something other than the compiled file. You can direct GCC to compile the C file and stop at the assembly. By comparing the assembly files, you might see the effects of the options.

If that's what you're after, try this command
Code:
gcc -S -o output.asm input.c
 
1 members found this post helpful.
Old 04-13-2010, 02:53 PM   #4
Ajit Gunge
Member
 
Registered: Jan 2008
Location: Pune
Distribution: RHEL,fedora
Posts: 253
Blog Entries: 1

Original Poster
Rep: Reputation: 21
Smile

Hi Modprob.I tried your suggestion but I dont see much difference in the two asm files that I run with with the options.

Thanks for letting me know the -S option though
 
Old 04-13-2010, 02:55 PM   #5
modprob
Member
 
Registered: Jul 2009
Location: Montreal
Distribution: Slackware
Posts: 35

Rep: Reputation: 17
The fno-inline option is a hint to GCC. It can choose to ignore it.
 
  


Reply


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
Compiling for Speed? - where does Ubuntu keep the options? GTrax Ubuntu 4 01-12-2010 08:29 AM
kernel compiling options slinky2004 Linux - General 6 10-10-2005 08:46 PM
compiling perl with c options fobius Slackware 1 10-06-2004 10:05 PM
Compiling ip_queue with other options? Jimbo Mahoney Linux - General 1 06-08-2003 06:17 PM
Kernel Compiling options moger Linux - General 1 09-26-2002 11:28 PM


All times are GMT -5. The time now is 08:27 PM.

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