LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-02-2023, 06:45 AM   #1
ajiten
Member
 
Registered: Jun 2023
Posts: 375

Rep: Reputation: 4
gcc options: --save-temps, --verbose; and redirection operator.


I have a quicksort.c file, that compiled using, the below commands:

Code:
$ gcc --save-temps --verbose quicksort.c -o  quicksort> quicksort.txt
The gcc command options (a) --save-temps, & (b) --verbose; are taken from a book, that states:
Code:
# Compiling with verbose option and preserving the intermediate files
$ gcc --save-temps --verbose ex1.c -o ex1
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
gcc version 2.95.3-5 (cygwin special)
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/cpp0.exe -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -
D_X86_=1 -D_X86_=1 -Asystem(winnt) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -
Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ -
D__stdcall=__attribute__((__stdcall_)) -D__cdecl=__attribute__((__cdecl__)) -
D_stdcall=__attribute__((__stdcall__)) -D_cdecl=__attribute__((__cdecl__)) -
D__declspec(x)=__attribute__((x)) -D__CYGWIN32__ -D__CYG WIN__ -Dunix -D__unix__ -D__unix -isystem/
usr/local/include -idirafter /usr/include -idirafter /usr/include/w32api ex1.c ex1.i
GNU CPP version 2.95.3-5 (cygwin special) (80386, BSD syntax)
#include “...” search starts here:
#include <...> search starts here:
 /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include
 /usr/include
 /usr/include/w32api
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
 /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/cc1.exe ex1.i -quiet -dumpbase ex1.c -version -o ex1.s
GNU C version 2.95.3-5 (cygwin special) (i686-pc-cygwin) compiled by GNU C version 2.95.3-5 
cygwin special).
 /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/as.exe -o ex1.o ex1.s
 /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/collect2. exe -Bdynamic --dll-search-pref x=cyg -o
ex1.exe /usr/lib/crt0.o -L/usr/local/lib -L/usr/lib -L/usr/lib/w32api -L/usr/lib/gcc-lib/i686-pc -
cygwin/2.95.3-5 ex1.o -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc
But, don't remember from where took the subscript of redirection: > text_file; i.e.: > quicksort.txt

So, two doubts:
1. Unable to grasp the full significance, and how to use for debug, or other purposes, the significance of the two options; i.e., (a): --save-temps, &: (b) --verbose.
2. The purpose of the redirection, at the end of the command; as if get compilation done correctly, or wromg; it has empty file; here: quicksort.txt.

Last edited by ajiten; 07-02-2023 at 06:48 AM.
 
Old 07-02-2023, 07:06 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Just curious: why GCC 2.95? It's very old.

See Debugging options in the GNU GCC manual. --save-temps is described there. --verbose should be a linker option.

Last edited by shruggy; 07-02-2023 at 07:10 AM.
 
Old 07-02-2023, 07:09 AM   #3
ajiten
Member
 
Registered: Jun 2023
Posts: 375

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by shruggy View Post
Just curious: why GCC 2.95? It's very old.

...
As the book's contents are quoted, which got published in 2010.

Last edited by ajiten; 07-02-2023 at 07:10 AM.
 
Old 07-02-2023, 03:21 PM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,866
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
It is safe to drop these, instead:
Code:
 gcc -m64 -g -Wall -W -Werror -pedantic quicksort.c -o  quicksort
 
Old 07-03-2023, 12:20 AM   #5
ajiten
Member
 
Registered: Jun 2023
Posts: 375

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by NevemTeve View Post
It is safe to drop these, instead:
Code:
 gcc -m64 -g -Wall -W -Werror -pedantic quicksort.c -o  quicksort
Thanks, but request to tell the purpose of rediection, used at the end; as must have copied from somewhere.

Also, request to see my last response at: https://www.linuxquestions.org/quest...ml#post6439714
 
Old 07-03-2023, 12:30 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,864

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
Quote:
Originally Posted by ajiten View Post
Thanks, but request to tell the purpose of rediection, used at the end; as must have copied from somewhere.

Also, request to see my last response at: https://www.linuxquestions.org/quest...ml#post6439714
do not open more threads with the same topic. See rules:
Quote:
Do not post the same discussion multiple times. Duplicate discussions can be frustrating for other members. Try and pick the most relevant forum for your post. If you are unsure put it in Linux - General.
Do not use gcc 2.95, even 4.8 is extremely outdated. I suggest you to use a newer one. How did you get that very old version? What OS is it?
 
1 members found this post helpful.
  


Reply



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
[SOLVED] Bash Shell Multiline Commenting and << redirection operator tercel Linux - Newbie 10 08-25-2022 01:29 AM
LXer: Build a Kubernetes Operator in 10 minutes with Operator SDK LXer Syndicated Linux News 0 03-26-2020 07:40 AM
LXer: IBM's Red Hat Deal, NuoDB Operator Now Has Red Hat OpenShift Operator Certification, Krita 4.2.0 Alpha Released, Elive 3.0 Update, UBp LXer Syndicated Linux News 0 05-09-2019 06:21 PM
[SOLVED] C++ Operator Overloading Within an Already Overloaded Operator mirlin510 Programming 8 04-17-2011 12:02 PM
redirection < operator not working pls help Fond_of_Opensource Linux - Newbie 3 08-25-2006 02:35 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:04 AM.

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
Open Source Consulting | Domain Registration