C99 Versus ANSI.

S

sunny

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?
 
R

Richard Heathfield

sunny said:
Hi All

What is C99 Standard is all about.

It's the replacement to C, and popular implementations might be porting to
C99 Any Decade Now.
is it portable,

No. Some compilers implement some bits of it. Other compiler implement other
bits. Some implement some bits of it /wrong/ (or, at least, differently to
what C99 requires, perhaps through bugginess or ignorance, but possibly for
good reasons of their own). Some compilers don't implement any of it. And a
handful of (not so well-known) compilers implement it all.
i mean i saw
-std=C99 option in GCC

It's a misnomer. What it means is "the bits of C99 which we can be bothered
to implement" (which, to be fair, is quite a lot of it). But not all gcc
versions have a -std=C99 option. Mine, for instance, does not.
but there is no such thing in VC++.?

Right. Microsoft are not actively seeking to support C99.
which one is better ANSI C / C99?

That depends on what you mean by "better".
can i know the major difference between C99 & ANSI C standards?

http://home.tiscalinet.ch/t_wolf/tw/c/c9x_changes.html
 
J

jacob navia

sunny said:
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.

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.

, i mean i saw
-std=C99 option in GCC
but there is no such thing in VC++.?

VC++ doesn't care about C development and has abandonend
most C development to concentrate on C# C++ and other languages.
which one is better ANSI C / C99?

C99 offers most of the all standard (including warts like gets())
and adds significant functionality.

can i know the major difference between C99 & ANSI C standards?

http://home.tiscalinet.ch/t_wolf/tw/c/c9x_changes.html
 
R

Richard Heathfield

jacob navia said:
It is the current C standard, as defined by ANSI/ISO. The old standard
(C89) is now obsolete.

Merriam-Webster defines "obsolete" as "no longer in use or no longer
useful", which is certainly not true of C89. It also offers "of a kind or
style no longer current", which again is not true of C89.
is it portable

Yes.

Provided you are prepared to spend money replacing your C90 compilers with
newer versions, and provided you aren't too picky about which platforms you
want to port to.
There are compilers for it under linux, windows, and many
other operating systems and implementations.

How about OS390? VM/CMS? UNICOS? SHARC?
Microsoft doesn't implement it,

So it is effectively non-portable, since a great many C programmers are
required to use the compiler supplied by their employer, and for a great
many employers, Microsoft is the preferred supplier for Windows-based
development software.

<snip>
 
J

jmcgill

sunny said:
Hi All

What is C99 Standard is all about.

It takes a long time for standards to become widely adopted in the field.
is it portable

It is portable among systems implementing the standard, if you can find
any.

i mean i saw
-std=C99 option in GCC

GCC is working towards C99 conformance, but it's not complete.
but there is no such thing in VC++.?

And Microsoft reports having no plans to implement this standard.
which one is better ANSI C / C99?

Which one is better, ketchup or mustard?
can i know the major difference between C99 & ANSI C standards?

What qualifies as "major" is a matter of opinion. Some important
differences

.. Identifiers have increased significant length
.. "//" style comments are allowed
.. Variable arguments in macros
.. Inline functions
.. Restricted pointers (can be "restricted" from pointing to the same
object.)
.. a _Bool type
.. Vars can be declared anywhere in a block
.. Functions no longer return 'int' by default
.. Last data member of a struct can be an array of unspecified size
.. Complex number type
.. Repeated type qualifier is folded into a single qualifier. (Though a
special case is made for "long long" which provides a 64 bit integer type.


The "restricted pointer" (two pointers cannot reference the same memory
address) allows compiler implementors to perform certain optimizations:
http://www.accu.informika.ru/accu/events/public/c_news.htm

Complex (and a distinct "Imaginary") type will have applications in
signal processing and number-theoretic algorithms. With Complex numbers
being a language feature, implementations may be able to optimize
arithmetic operations, so that for instance, library calls will not be
necessary for arithmetic.

Some of these standards are already de-facto standards in many systems,
like "//" comments, long identifiers, inline functions, 64-bit "long
long", incomplete array in a struct.

Some are no doubt going to lead to more obfuscation opportunities.
Vararg macros? I can see very useful application for that, but I can
see more potential for abuse.

Read "The Rationale for the C99 Standard"

http://std.dkuug.dk/JTC1/SC22/WG14/www/C99RationaleV5.10.pdf
 
R

Richard Heathfield

jmcgill said:
It takes a long time for standards to become widely adopted in the field.


It is portable among systems implementing the standard, if you can find
any.

Beautifully put.

GCC is working towards C99 conformance, but it's not complete.

When was the last change to GCC that increased its C99 conformance?

(I'm guessing four or five years ago, but I'll be glad to be proved wrong.
It would be nice to know they're at least still having a crack at it...)

Which one is better, ketchup or mustard?

Ketchup. No, mustard! Er, ketc...must...ke... mu.
 
J

jacob navia

jmcgill said:
It takes a long time for standards to become widely adopted in the field.




It is portable among systems implementing the standard, if you can find
any.

I find linux and windows are quite a big part of
the workstation market.
 
J

jacob navia

jmcgill said:
jacob navia wrote:




Linux and Windows having what, exactly, to do with the C99 standard?

because you said:
It is portable among systems implementing the standard, if you can find
any.

I found two
 
J

jmcgill

jacob said:
because you said:
It is portable among systems implementing the standard, if you can find
any.

I found two

Neither "windows" nor "linux" is a C99 compiler or runtime library, so I
really have no idea what you are trying to claim.
 
J

jacob navia

jmcgill said:
Neither "windows" nor "linux" is a C99 compiler or runtime library, so I
really have no idea what you are trying to claim.

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"

jacob
 
J

jmcgill

jacob said:
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"

There are some important features of C99 that are not yet implemented by
GCC. Comeau does not have a runtime library, but Dinkumware+Comeau
solves that problem. There is an IBM compiler that you do not mention,
which is said to be a complete C99 implementation.

If you are willing to consider GCC4.x as a C99 compiler despite its
limitations, then there is a long, long list of target platforms that
support it.

I suspected your messages were just an effort to be contrary.
 
J

jacob navia

jmcgill said:
I suspected your messages were just an effort to be contrary.

No, it is because hearthfield took
"if you can find them" as an ironic way of saying
"almost none exists"

I am aware that the refusal by microsoft of accepting
c99 is a BIG stumbling block, but nevertheless, there
are many compiler that support it.

jacob
 
R

Richard Heathfield

jacob navia said:

Actually, it looks that you meant "compiler system". Well,
my answer stays, gcc implements C99 under unix,

No, it doesn't. There is no fully C99-conforming version of gcc at present.
and under windows there is intel compiler,

Got a URL? All I could find on their site were C++ compilers.
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.
and Comeau, that actually also runs under Unix.

Certainly true, but "it also supports many of the C99 features provided by
this new revised ISO Standard for C" - which indicates that it is not in
fact C99-conforming in all respects.
That makes for more than two "compiler systems"

No, it doesn't.
 
G

Guest

Richard said:
jacob navia said:

Got a URL? All I could find on their site were C++ compilers.

The "Intel C++ Compiler" is a less than perfect name; ICC includes
separate C and C++ compilers. I don't know if it's a conforming
implementation, though; from their own site:

http://www.intel.com/support/performancetools/c/sb/cs-015003.htm
C Standard Conformance
The Intel® C++ Compilers provide some conformance to the ANSI/ISO
standard for C language compilation (ISO/IEC 9899:1999).

For more information on C conformance, refer to the User's Guide.

"Some conformance" ? (In fairness though, I don't know of any issues
icc may have that would make it nonconforming.)
 
J

jacob navia

Harald said:
The "Intel C++ Compiler" is a less than perfect name; ICC includes
separate C and C++ compilers. I don't know if it's a conforming
implementation, though; from their own site:

http://www.intel.com/support/performancetools/c/sb/cs-015003.htm
C Standard Conformance
The Intel® C++ Compilers provide some conformance to the ANSI/ISO
standard for C language compilation (ISO/IEC 9899:1999).

For more information on C conformance, refer to the User's Guide.

"Some conformance" ? (In fairness though, I don't know of any issues
icc may have that would make it nonconforming.)

It is business talk.

If you write

This is 100% conforming you are liable if there is the
slightest bug. If you write "some" conformance, you are
not.
 
J

jacob navia

Richard said:
jacob navia said:




No, it doesn't. There is no fully C99-conforming version of gcc at present.




Got a URL? All I could find on their site were C++ compilers.




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.

I have "a limited knowledge of C". I am not "the GURU",
and I do make mistakes.

Other people, think that they have "unlimited knowledge
of C", they know everything.

I am not that kind of person.
 
G

Guest

jacob said:
It is business talk.

If you write

This is 100% conforming you are liable if there is the
slightest bug. If you write "some" conformance, you are
not.

Then explain to me why they do claim full C++ conformance at the very
same page for the Linux version, and only a single issue with C++
conformance for the Windows version.
 
R

Richard Heathfield

jacob navia said:
It is business talk.

If you write

This is 100% conforming you are liable if there is the
slightest bug. If you write "some" conformance, you are
not.

So what you seem to be saying is that even the people who wrote the compiler
are not convinced it's fully conforming. So why should anyone else be
convinced?
 

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

Similar Threads


Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top