Info about the GNU C Compiler...?

M

Marc Boyer

Le 26-04-2007 said:
I know it is a free compiler. But does it follow any standard? If so
which standard is it? (Ansi, Ecma, etc?)

Did you have a single look at GCC documentation before posting ?
Google GCC -> http://gcc.gnu.org/onlinedocs/ ->
* GCC 4.1.2 Manual ->
# 1 Programming Languages Supported by GCC
# 2 Language Standards Supported by GCC

Marc Boyer
 
A

arun

I know it is a free compiler. But does it follow any standard? If so
which standard is it? (Ansi, Ecma, etc?)
 
R

Richard Heathfield

arun said:
I know it is a free compiler. But does it follow any standard? If so
which standard is it? (Ansi, Ecma, etc?)

The gcc/glibc implementation conforms extremely well to the 1989 ANSI C
Standard, which was later adopted by ISO as ISO/IEC 9899:1990.

It does not claim to conform to the later 1999 ISO Standard, but does in
fact support most of that Standard's changes to C. It reached this "not
quite there" conformance level some years ago, and shows no signs of
approaching C99 any more closely for the foreseeable future.
 
W

Walter Roberson

arun said:
The gcc/glibc implementation conforms extremely well to the 1989 ANSI C
Standard, which was later adopted by ISO as ISO/IEC 9899:1990.

[OT]
Does gcc still assert __STDC__ when language extensions have been
allowed (i.e., when the compiler was not invoked in strict
conformance mode) ? They used to do that, and would excuse it
by saying "Compilers which do not adhere to the ANSI/ISO standards
are free to do whatever they want, including asserting macros that
might lead a program to believe that it ws being compiled by
an ANSI/ISO standard compiler."
 
C

Clever Monkey

Richard said:
arun said:


The gcc/glibc implementation conforms extremely well to the 1989 ANSI C
Standard, which was later adopted by ISO as ISO/IEC 9899:1990.

It does not claim to conform to the later 1999 ISO Standard, but does in
fact support most of that Standard's changes to C. It reached this "not
quite there" conformance level some years ago, and shows no signs of
approaching C99 any more closely for the foreseeable future.
.... like most C compilers...
 
G

Gregor H.

The gcc/glibc implementation conforms extremely well to the 1989 ANSI C
Standard, which was later adopted by ISO as ISO/IEC 9899:1990.
Especially when called with the options

-std=c89 -pedantic
or
-std=iso9899:1990 -pedantic
or
-ansi -pedantic


G.
 
G

Gregor H.

It does not claim to conform to the later 1999 ISO Standard, but does in
fact support most of that Standard's changes to C.
For more details, see:

http://gcc.gnu.org/gcc-4.1/c99status.html
It reached this "not quite there" conformance level some years ago, and
shows no signs of approaching C99 any more closely for the foreseeable
future.
Indeed. :-(


(For example,

feature: variable-length arrays -- Broken
feature: complex (and imaginary) support in <complex.h> -- Broken
feature: inline functions -- Broken

and so on...)


G.
 
R

Richard Tobin

Walter Roberson said:
Does gcc still assert __STDC__ when language extensions have been
allowed (i.e., when the compiler was not invoked in strict
conformance mode) ? They used to do that, and would excuse it
by saying "Compilers which do not adhere to the ANSI/ISO standards
are free to do whatever they want, including asserting macros that
might lead a program to believe that it ws being compiled by
an ANSI/ISO standard compiler."

That's an argument as to why it's legal, but presumably they have a
real reason for doing it. Most likely it's that people usually use
__STDC__ to ensure that standard features are available, rather than
to ensure that extensions are not.

Can you give an example of using __STDC__ for the latter purpose?

-- Richard
 
K

Keith Thompson

That's an argument as to why it's legal, but presumably they have a
real reason for doing it. Most likely it's that people usually use
__STDC__ to ensure that standard features are available, rather than
to ensure that extensions are not.

In fact, using it to ensure that extensions are not available is a
misuse. C99 4p6:

A conforming implementation may have extensions (including
additional library functions), provided they do not alter the
behavior of any strictly conforming program.

In its default non-conforming mode, I think gcc's main point of
non-conformance is its failure to issue some required diagnostics.
 
C

CBFalconer

arun said:
Ok. Is it also true that parts of the linux kernel was made with the
same compiler?

What same compiler. What else is supposed to be true? Don't
assume your readers can see the subject line. See below.

--
If you want to post a followup via groups.google.com, ensure
you quote enough for the article to make sense. Google is only
an interface to Usenet; it's not Usenet itself. Don't assume
your readers can, or ever will, see any previous articles.
More details at: <http://cfaj.freeshell.org/google/>
 
R

Richard

CBFalconer said:
What same compiler. What else is supposed to be true? Don't
assume your readers can see the subject line. See below.

Huh? What below?

The subject, btw, is an integral part of a post. Hence it is called the
"subject".
 
C

Chris Dollin

Richard said:
The subject, btw, is an integral part of a post. Hence it is called the
"subject".

"Integral part" doesn't necessarily mean "conveniently visible".

Exhibits (as it weren't) A, B, and C: my heart, your brain, and
CBFalconer's liver.
 
M

Martin Ambuhl

Chris said:
"Integral part" doesn't necessarily mean "conveniently visible".

And, as anyone who has more than 5 minutes experience in newsgroups
knows, it doesn't necessarily mean, and all too frequently doesn't mean
"even tangentially related to the post." That's one of the reasons that
many regulars don't even bother looking at them when they _are_
"conveniently visible." The basic rule of thumb is: if it is worth
saying at all, its worth stating in the body of the post. Something so
unimportant that you can't be bothered putting in the body of the post
is *properly* ignored.
 
M

Martin Ambuhl

Richard said:
Huh? What below?

The subject, btw, is an integral part of a post. Hence it is called the
"subject".

Your post has the headers quoted below. What is your standard for
deciding that one of them is "an integral part of a post"? How many of
these should we inspect to discover information you have hidden,
information so negligible and unimportant that you can't bother to put
it in the body of the post? Damn! If I'd only known that you were
using "Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.91 (gnu/linux)" I could
have figured out what you question was. Acutally, if I had noticed that
you were using gmail.com, I would have realized that you were clueless.
 
D

deostroll

The Linux kernel is certainly copmiled with GCC.
--Richard

So considering the fact that

a) the GNU C compiler adopts an open standard,
b) and the compiler is free,

does this mean that we cannot anti-socially hack linux?

--deostroll

PS: Frankly I don't know what to do about the fact other ppl not being
able to read my prev posts! And, yes, I am doing all of this from
google groups.
 
M

Mark McIntyre

Huh? What below?

The below that was in his sig.
The subject, btw, is an integral part of a post.

So is the X-Tace line. Would you expect to need to read that to
understand a post?
Hence it is called the "subject".

"Hence" ?
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top