473,883 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C99 Versus ANSI.

Hi All

What is C99 Standard is all about. is it portable, i mean i saw
-std=C99 option in GCC
but there is no such thing in VC++.?

which one is better ANSI C / C99?
can i know the major difference between C99 & ANSI C standards?

Sep 27 '06
83 11663
jacob navia said:
Richard Heathfield wrote:
>jacob navia said:
<snip>
>>
>>>lcc-win32

Given the maintainer's limited knowledge of C as evidenced in
comp.lang.c, I must say I entertain certain doubts about whether
lcc-win32 is C99-conforming in all respects.

Given the history of pedantic remarks you use,
it is obvious that you can't refrain.

But if you want it, you are right.
So far, then, we have exactly ZERO conforming implementations of C99. So
much for that.
--
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 27 '06 #21
Richard Heathfield wrote:
jacob navia said:
Richard Heathfield wrote:
jacob navia said:
<snip>
>
lcc-win32

Given the maintainer's limited knowledge of C as evidenced in
comp.lang.c, I must say I entertain certain doubts about whether
lcc-win32 is C99-conforming in all respects.
Given the history of pedantic remarks you use,
it is obvious that you can't refrain.

But if you want it, you are right.

So far, then, we have exactly ZERO conforming implementations of C99. So
much for that.
You mean one, right? IBM's? It was mentioned in this thread, and from
http://www-306.ibm.com/software/awdt...cpp/features/:
"The C and the C++ compilers conform to the latest ISO/IEC
International Standards. The C compiler supports the latest ISO C 1999
(International Standard ISO/IEC 9899:1999) standard, also known as C99."

Sep 27 '06 #22
Harald van Dijk wrote:
Richard Heathfield wrote:
>>jacob navia said:

>>>Richard Heathfield wrote:

jacob navia said:

<snip>
>>>>>lcc-win32

Given the maintainer's limited knowledge of C as evidenced in
comp.lang.c , I must say I entertain certain doubts about whether
lcc-win32 is C99-conforming in all respects.
Given the history of pedantic remarks you use,
it is obvious that you can't refrain.

But if you want it, you are right.

So far, then, we have exactly ZERO conforming implementations of C99. So
much for that.


You mean one, right? IBM's? It was mentioned in this thread, and from
http://www-306.ibm.com/software/awdt...cpp/features/:
"The C and the C++ compilers conform to the latest ISO/IEC
International Standards. The C compiler supports the latest ISO C 1999
(International Standard ISO/IEC 9899:1999) standard, also known as C99."
If you ignore pedantic people, there are MANY more. Intel's, gcc, and
many others are almost 100% conformant. A few irrelevant issues are
a justification fgor pedantic people to scream "NO, there is NONE"

Just ignore them
Sep 27 '06 #23
jacob navia <ja***@jacob.re mcomp.frwrites:
sunny wrote:
>Hi All
What is C99 Standard is all about.

It is the current C standard, as defined by ANSI/ISO. The old standard
(C89) is now obsolete.
C89 (or, equivalently, C90) is "obsolete" only in a very narrow and
legalistic sense. The C99 standard *offically* supersedes the C90
standard, but it is not widely implemented. The only reliable way to
produce portable C code is to limit yourself to the C90 standard,
while avoiding incompatibiliti es with C99 (for example, don't use
"restrict" as an identifier, because it's a keyword in C99 but not in
C90). The resulting code, if written carefully, will work correctly
under both C90 and C99 implementations .

C90 is still widely used and widely supported. C99 (by which I mean
the full language defined by the C99 standard) is not.

jacob, you know this perfectly well.
is it portable

Yes. There are compilers for it under linux, windows, and many
other operating systems and implementations . Microsoft doesn't
implement it, but you can find compilers like intel compiler
that implements it. Comeau C/C++ implements C99 also.
There are a very few compilers that *fully* support C99. Intel's
compiler does not, as far as I know; we discussed this here recently.

[snip]
>which one is better ANSI C / C99?

C99 offers most of the all standard (including warts like gets())
and adds significant functionality.
Significance is in the eye of the beholder. C99 has some nice
features, but none that I can't get along without.

If you insist on using the full C99 language, you're going to have to
avoid using any compilers that don't fully support it. That means you
won't be able to use gcc, any Microsoft compiler, or lcc-win32.

--
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 27 '06 #24
jacob navia <ja***@jacob.re mcomp.frwrites:
[...]
Excuse me, I misunderstood "system" as operating system.
Actually, it looks that you meant "compiler system". Well,
my answer stays, gcc implements C99 under unix, and under windows
there is intel compiler, lcc-win32 and Comeau, that actually
also runs under Unix.

That makes for more than two "compiler systems"
It does not, as you know perfectly well.

gcc does not fully support C99. See
<http://gcc.gnu.org/c99status.htmlf or details. And of course gcc
uses the operating system's C library, so even if the compiler were
100% C99 compliant, the *implementation * would not be on many systems.

I don't believe that Intel's compiler fully supports C99. If you can
demonstrate that it does, please do so.

When I asked you about lcc-win32's C99 support in comp.compilers. lcc
just a few weeks ago, you wrote:
| No, there isn't a listing but I am implementing as time
| permits.
|
| Designated initializers and structure initializers with the
| dot notation are missing.
|
| I am giving priority to the library, that is kind of
| "mostly" finished. I have probably some problems with
| complex numbers, there hasn't been a good testing of that
| part.
|
| Besides the preprocessor is still missing the variable
| arguments feature.

I don't know Comeau's status, and I've never used it.

So that's *at most* one C implementation that fully supports C99.

I am *astonished* that you would claim that lcc-win32 implements C99,
after having explicitly stated that it does not.

And if you consider a compiler that supports only a *subset* of C99 to
be a "C99 compiler", then every conforming C90 compiler is a C99
compiler; after all, C90 is most of C99.

--
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 27 '06 #25
Keith Thompson wrote:
I don't believe that Intel's compiler fully supports C99. If you can
demonstrate that it does, please do so.
Having just tested it, I can demonstrate that it does not.

$ cat test.c
int main (void)
{
printf ("Hello, world!\n");
}
$ icc --version
icc (ICC) 9.1 20060816
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.

$ icc -strict-ansi -c99 -Wall test.c -o test
$ ./test
Hello, world!

(C99 requires a diagnostic for syntax errors, and undeclared
identifiers are a syntax error.)

Sep 27 '06 #26
Keith Thompson posted:
C89 (or, equivalently, C90) is "obsolete" only in a very narrow and
legalistic sense. The C99 standard *offically* supersedes the C90
standard, but it is not widely implemented. The only reliable way to
produce portable C code is to limit yourself to the C90 standard,
while avoiding incompatibiliti es with C99 (for example, don't use
"restrict" as an identifier, because it's a keyword in C99 but not in
C90). The resulting code, if written carefully, will work correctly
under both C90 and C99 implementations .

I wonder if there are many circumstances in which certain behaviour was
defined by the C89 Standard, but then became undefined by the C99 Standard? I
can think of one instance:

int Func(void) {}

int main(void) { Func(); return 0; }

--

Frederick Gotham
Sep 27 '06 #27
Frederick Gotham wrote:
Keith Thompson posted:
C89 (or, equivalently, C90) is "obsolete" only in a very narrow and
legalistic sense. The C99 standard *offically* supersedes the C90
standard, but it is not widely implemented. The only reliable way to
produce portable C code is to limit yourself to the C90 standard,
while avoiding incompatibiliti es with C99 (for example, don't use
"restrict" as an identifier, because it's a keyword in C99 but not in
C90). The resulting code, if written carefully, will work correctly
under both C90 and C99 implementations .


I wonder if there are many circumstances in which certain behaviour was
defined by the C89 Standard, but then became undefined by the C99 Standard? I
can think of one instance:

int Func(void) {}

int main(void) { Func(); return 0; }
This is a strictly conforming program in C99.

Sep 27 '06 #28
=?utf-8?B?SGFyYWxkIHZ hbiBExLNr?= posted:
>int Func(void) {}

int main(void) { Func(); return 0; }

This is a strictly conforming program in C99.

Over on comp.lang.c++, we were discussing the idea of a non-void-returning
function not having a return statement. One of the participants claimed that
it was UB in C99 because of the following:

(section 6.8.6.4/1,
a constraint on the return statement): "A return statement without an
expression shall appear only in a function whose return type is void."

However, I read that to mean that the following is broken:

int Func(void) { return; }

rather than the following being broken:

int Func(void) {}

--

Frederick Gotham
Sep 27 '06 #29
Harald van D?k said:
Richard Heathfield wrote:
<snip>
>So far, then, we have exactly ZERO conforming implementations of C99. So
much for that.

You mean one, right? IBM's? It was mentioned in this thread,
Oops, must have missed that. Okay, one, then.

And presumably the C99 source code is portable between the IBM compiler
and... er... the IBM compiler. Excellent. Nice one, ISO.

--
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 27 '06 #30

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

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.