473,651 Members | 2,533 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compiler flags

Can someone point me to a website that lists the compiler flags for the
Linux c++ compiler. Yes, I know it's called c++ but I am using it to
compile .c files.

Sep 10 '06 #1
20 9286

spasmous wrote:
Can someone point me to a website that lists the compiler flags for the
Linux c++ compiler. Yes, I know it's called c++ but I am using it to
compile .c files.
There's a chap called Google who can be contacted at
http://www.google.com - he knows all about that sort of thing.

Sep 10 '06 #2
J. J. Farrell said:
>
spasmous wrote:
>Can someone point me to a website that lists the compiler flags for the
Linux c++ compiler. Yes, I know it's called c++ but I am using it to
compile .c files.

There's a chap called Google who can be contacted at
http://www.google.com - he knows all about that sort of thing.
That's like claiming that Mr Yellow Pages knows all about how to clean
drains, bake bread, drive taxis, and issue passports.

Google is a search engine, not an oracle. It doesn't know anything about
Linux, C++, or compiler flags. In fact, it knows little more than which
words appear on which Web sites. An intelligent Googler is well aware that
there is an awful lot of misinformation on the Web, for which Google cannot
reasonably be held responsible. Caveat surfer.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Sep 10 '06 #3
"spasmous" <sp******@gmail .comwrites:
Can someone point me to a website that lists the compiler flags for the
Linux c++ compiler. Yes, I know it's called c++ but I am using it to
compile .c files.
<OT>
The usual default compiler on Linux is gcc (it's actually a collection
of compilers for several languages, with a shared backend). There's a
command called "g++" that invokes it as a C compiler. Typically "cc"
and "c++" are installed as aliases for "gcc" and "g++", respectively.

If you want to compile C code, use a C compiler: either "gcc" or "cc",
not "g++", or "c++".

All this is explained in gcc documentation, which you can see by
typing "info gcc" or by doing a Google search for "gcc documentation".
</OT>

If you have any more questions about gcc (that aren't answered by the
documentation), try gnu.gcc.help. If you have questions about Linux,
try one of the many Linux newsgroups, or perhaps comp.unix.progr ammer.
If you have questions about the C language itself, this is the right
place.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Sep 10 '06 #4
spasmous a écrit :
Can someone point me to a website that lists the compiler flags for the
Linux c++ compiler. Yes, I know it's called c++ but I am using it to
compile .c files.
You should learn to read the documentation.

Just write:

info gcc
or
man gcc

and the associated documentation will tell you ALL compiler
flags, and what they do.

Sep 10 '06 #5

jacob navia wrote:
spasmous a écrit :
Can someone point me to a website that lists the compiler flags for the
Linux c++ compiler. Yes, I know it's called c++ but I am using it to
compile .c files.

You should learn to read the documentation.

Just write:

info gcc
or
man gcc

and the associated documentation will tell you ALL compiler
flags, and what they do.
Thanks - I didn't realize c++ was an alias of gcc. Sometimes, you know,
you have to compile someone else's programs on a platform that you
don't know. man c++ was my first try, then google on Linux c++ compiler
flags. Neither produced anything obviously useful.

Next was look for the group with most hits on my google search and post
there. Which is what I did. Sorry your NG is not pure enough for you
guys - but thank you for your suggestions.

Sep 10 '06 #6
"spasmous" <sp******@gmail .comwrites:
Can someone point me to a website that lists the compiler flags for the
Linux c++ compiler. Yes, I know it's called c++ but I am using it to
compile .c files.
Assuming you mean gcc, the appropriate flags are here (from Richard
Heathfield at some point in the past):
gcc -W -Wall -ansi -pedantic -Wformat-nonliteral -Wcast-align
-Wpointer-arith -Wbad-function-cast -Wmissing-prototypes
-Wstrict-prototypes -Wmissing-declarations -Winline -Wundef
-Wnested-externs -Wcast-qual -Wshadow -Wconversion -Wwrite-strings
-Wno-conversion -O3

Jacob Navia recommends adding -Wextra for the latest version of gcc.

Rather unfortunately, you have to fix the spacing yourself.

--
Andrew Poelstra <http://www.wpsoftware. net/projects>
To reach me by email, use `apoelstra' at the above domain.
"Do BOTH ends of the cable need to be plugged in?" -Anon.
Sep 11 '06 #7
Andrew Poelstra <ap*******@fals e.sitewrites:
"spasmous" <sp******@gmail .comwrites:
>Can someone point me to a website that lists the compiler flags for the
Linux c++ compiler. Yes, I know it's called c++ but I am using it to
compile .c files.

Assuming you mean gcc, the appropriate flags are here (from Richard
Heathfield at some point in the past):
gcc -W -Wall -ansi -pedantic -Wformat-nonliteral -Wcast-align
-Wpointer-arith -Wbad-function-cast -Wmissing-prototypes
-Wstrict-prototypes -Wmissing-declarations -Winline -Wundef
-Wnested-externs -Wcast-qual -Wshadow -Wconversion -Wwrite-strings
-Wno-conversion -O3

Jacob Navia recommends adding -Wextra for the latest version of gcc.

Rather unfortunately, you have to fix the spacing yourself.
<OT>
-Wextra is a newer name for -W. "info gcc" for details.
</OT>

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Sep 11 '06 #8
Andrew Poelstra said:
Assuming you mean gcc, the appropriate flags are here (from Richard
Heathfield at some point in the past):
gcc -W -Wall -ansi -pedantic -Wformat-nonliteral -Wcast-align
-Wpointer-arith -Wbad-function-cast -Wmissing-prototypes
-Wstrict-prototypes -Wmissing-declarations -Winline -Wundef
-Wnested-externs -Wcast-qual -Wshadow -Wconversion -Wwrite-strings
-Wno-conversion -O3
No, this set is from "those who know me have no need of my name" - all I did
was pinch it. (And he's been looking for it ever since.)

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Sep 11 '06 #9
Keith Thompson wrote:
Andrew Poelstra <ap*******@fals e.sitewrites:
>"spasmous" <sp******@gmail .comwrites:
>>Can someone point me to a website that lists the compiler flags
for the Linux c++ compiler. Yes, I know it's called c++ but I am
using it to compile .c files.

Assuming you mean gcc, the appropriate flags are here (from Richard
Heathfield at some point in the past):
gcc -W -Wall -ansi -pedantic -Wformat-nonliteral -Wcast-align
-Wpointer-arith -Wbad-function-cast -Wmissing-prototypes
-Wstrict-prototypes -Wmissing-declarations -Winline -Wundef
-Wnested-externs -Wcast-qual -Wshadow -Wconversion -Wwrite-strings
-Wno-conversion -O3

Jacob Navia recommends adding -Wextra for the latest version of gcc.

Rather unfortunately, you have to fix the spacing yourself.

<OT>
-Wextra is a newer name for -W. "info gcc" for details.
</OT>
Here is my set, implemented via an alias:

-W -Wall -ansi -pedantic -Wwrite-strings -Wfloat-equal -gstabs+ -O1

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>

--
Posted via a free Usenet account from http://www.teranews.com
Warning: Do not use Ultimate-Anonymity
They are worthless spammers that are running a scam.

Sep 11 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2329
by: Jeff Epler | last post by:
Hello. Recently, Generator Comprehensions were mentioned again on python-list. I have written an implementation for the compiler module. To try it out, however, you must be able to rebuild Python from source, because it also requires a change to Grammar. 1. Edit Python-2.3/Grammar/Grammar and add an alternative to the "listmaker" production: -listmaker: test ( list_for | (',' test)* )
43
3411
by: Mr.Tickle | last post by:
// Run this code and look for his obvious error by the compiler namespace FlagCheck { using System; enum SomeFlags {
20
2711
by: News | last post by:
I'm new to c and gcc. I was wondering if anyone can point me to a web page or book that has a list of the warning messages and their meanings. Are the warnings the same no matter what compiler you use, or are they different for each compiler? I have looked all over the gcc web site, but I can't find anything that explains what the warnings are. If someone could take the time to help me out and direct me to some info about this, I'd...
7
2214
by: ajm | last post by:
Hi All, given an object file is there any way (or tool) to determine which compiler created it ? tia, A.
0
1044
by: cody | last post by:
I propose that if an enum has FlagsAttribute set and its member have not they values explicitly assigned I'd propose that the compiler should emit a warning. Also if fields are not power of two (or a combination of other fields). public enum ABCD { A, // warning, not initialized B = 1, // ok
30
1722
by: Philippe Bertrand | last post by:
Is this a bug in the C# compiler or CLR runtime? enum MyEnum { ZERO = 0, ONE = 1, TWO = 2 } class Foo { public Foo(string,object) { ... } public Foo(string,MyEnum) { ... } } Foo f = new Foo("", 0); // Uses Foo(string,MyEnum) constructor instead of Foo(string,object)
1
11770
by: Neil Zanella | last post by:
Hello, I would like to know how to generate XML documentation from C# XML documentation comments using the Mono C# compiler. Basically, with the .NET C# compiler it is possible to generate such documentation with a command such as: csc /doc:HowdyPartner.xml HowdyPartner.cs How is this done with the Mono C# (mcs) compiler?
21
1869
by: polychrom | last post by:
Is there some good and convenient C compiler (freeware), to compile C source code? Just compile ready source code, some handy tool for non programmers. thanks.
1
1458
by: mukundan.narayanan | last post by:
cat mystring.cpp #include <iostream> #include <string> using namespace std; string mystring ("ABC"); int main() {
0
8349
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8695
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8460
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7296
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.