Difference between C89 and C99?

L

lawrence.jones

Mark McIntyre said:
Remind me: does the international copyright convention still allow
'fair use' ? If so, ANSI's method of distribution would seem to be
illegal if it prevents copying of small chunks of text.

ANSI's distribution method requires you to agree to a (somewhat
ludicrous) license that's more restrictive than copyright law, which is
perfectly legal.

-Larry Jones

I'm a genius. -- Calvin
 
C

Chris Hills

CBFalconer said:
However N869 is quite adequate for most purposes, as long as you
are willing to recognize the failings. It has the great advantage
of having a text version, which the actual standard still fails to
supply. A text version can be searched and manipulated with
ordinary tools. Why ISO/ANSI refused to publish an official text
version is beyond comprehension.

No... it makes perfect business sense to any one involved in licensing.
Their goals are not the same as yours. The are publishers not engineers.
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ (e-mail address removed) www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
 
C

Chris Hills

Jason Curl said:
Chris said:
Jason Curl said:
I've seen the document N869.txt and the copy I could find talks about
C99. Is there anything that comprehensively describes the difference
between C89 and C99? I'd like to write code to be as portable as possible.

Thanks,
Jason.


K&R 1st ed was the original C description from the 1970's
It is now obsolete as regards being the C language specification.

K&R 2nd Ed pub 1988 their book update to C89
C89 is an ANSI standard from dated 1989
C90 is the ISO version and the first International C standard
These three should be the same. K&R were on the ANSI panel that
produced [ANSI] C89 and that became ISO-C90

There have been various Amendments and TC's in 93,4,5 etc

In 1999 there was a new version of the ISO-C standard. C99.
The problem is that despite 2 TC's to C99 there are no conforming
compilers for it. Most are part way between C90 and C99.

If you want to write portable C I would use C99 with A1 and the TC's It
is where (AFAIK) most of the compilers are at. Of course it depends what
you are writing and what sort of portability you want. For portability
there could be far more important issues than sticking to ISO-C

BTW
You should not be using any N*** document as these are committee working
documents and therefore not accurate. They have been superseded by the
published standard and will not include any/some/all changes (if any)
after the reviews.

Buy the standard if you want to work to it. Using an N*** document is
like trying to write a legal document using a dictionary which may have
an arbitrary number of spelling mistakes and incorrect definitions in
it.

Does the C99 standard differentiate between what's also in C89 and
what's new?

Not AFAIK
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ (e-mail address removed) www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
 
C

Chris Hills

Michael Wojcik said:
You keep making this claim, Chris, but I've yet to see any evidence
from you that the implementations which do claim C99 compliance are
not in fact conforming. I can think of at least three such implemen-
tations being cited here:


OK I stand corrected. C99 compilers are very Rare. How much of the
market do the three below cover? You do not list any mainstream systems.


- Comeau C plus the Dinkumware libraries
- Edison Design Group C plus the Dinkumware libraries
- HP Compaq C for OpenVMS for Alpha

Some others that claim conformance:

- IBM C for AIX v6
- Intel C v8, except for FP_CONTRACT, FENV_ACCESS, and
CX_LIMITED_RANGE
- Lund Multiprocessor Complier Company LMPCC C99 v1.3

EDG+Dinkumware and LMPCC have received CVSA certificates.

So, if you have evidence that none of these is conforming, please let
us know; and if not, you might want to try to be a little more
accurate in your claims.

Really, is it that much harder to say "C99 conforming implementations
are rare"?

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ (e-mail address removed) www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
 
C

Chris Croughton

Remind me: does the international copyright convention still allow
'fair use' ? If so, ANSI's method of distribution would seem to be
illegal if it prevents copying of small chunks of text.

These days the RIAA and DMCA seem to be not considering "fair use" a
factor, so I guess that if there is an international agreement the US
aren't now part of it. Although since they only prevent you doing it by
a convenient method (copy & paste) they could claim that you have the
same right of "fair use" as if it were a printed version (do it by hand
or take a photocopy or screen-shot), they don't have to make it easy for
you to do it.

Chris C
 
K

Kevin Bracey

In message <[email protected]>
Keith Thompson said:
I hardly think that they're "ubiquitous". I know of some platforms
that are not likely *ever* to have a conforming C99 compiler (though
they're not platforms that most of you are likely to use), and the
most widespread C implementation, gcc, is not fully conforming

But then gcc has never fully conformed to C90 either, so not much has
changed.
 
E

E. Robert Tisdale

Keith said:
E. Robert Tisdale writes:
[...]
What does "rare" mean?
It appears that you can get a C99 conforming compiler
for just about every platform that C programmers target.
If you want to be *accurate*, you should say,
"C99 conforming implementations are ubiquitous."

I hardly think that they're "ubiquitous".
I know of some platforms
that are not likely *ever* to have a conforming C99 compiler
(though they're not platforms that most of you are likely to use),
and the most widespread C implementation, gcc, is not fully conforming
(for example, variable-length arrays, complex and imaginary support
and inline functions are still marked as "broken", even in gcc 4.0.0).

Please show us an example of how gcc support for variable-length arrays
is "broken".
 
K

Kevin Bracey

In message <[email protected]>
CBFalconer said:
Where does it fail with -W -Wall -ansi -pedantic?

Floating point handling is the first thing that springs to mind. All the
rounding behaviour is totally non-conformant, AFAIK. Might be that that only
affects the x86, but it is its most mainstream platform.
 
T

Tim Prince

Kevin Bracey said:
In message <[email protected]>


Floating point handling is the first thing that springs to mind. All the
rounding behaviour is totally non-conformant, AFAIK. Might be that that
only
affects the x86, but it is its most mainstream platform.
Are you talking about the obsolescent support for x87 float and double?
Where is that disallowed by C90? In gcc for x86-64, you don't even get that
by default. In 32-bit gcc, standard options such
as -march=pentium4 -mfpmath=sse give you uniform precision. Are you
complaining that it's an option for most C compilers supporting such
processors?
 
M

Michael Wojcik

OK I stand corrected. C99 compilers are very Rare. How much of the
market do the three below cover?

That's completely beside the point. "There are no conforming
compilers" is wrong. Period.
You do not list any mainstream systems.

Comeau + Dinkumware can be used on various mainstream systems.

And I certainly do in the next section:

And could you please trim irrelevant quoted text when you reply?
(I suppose it's too much to ask for a standard signature separator.)
 
M

Michael Wojcik

Remind me: does the international copyright convention still allow
'fair use'? If so, ANSI's method of distribution would seem to be
illegal if it prevents copying of small chunks of text.

Fair use does not mandate that the publisher make it convenient to
copy; it only limits what constitutes copyright infringement.

And ANSI does not prevent copying. They disable one rather narrow
copying process (the copy-and-paste function when the document is
displayed by a renderer that respects the disable-copy function).
They can't stop you (programmatically) from retyping by hand and so
forth. Or from extracting the text from the PDF using something
other than Adobe Acrobat Reader.

In my other (semi-) profession, litcrit, I retype sometimes lengthy
quotations by hand all the time, so this whole thing strikes me as a
non-issue, but YMMV.

--
Michael Wojcik (e-mail address removed)

Although he was an outsider, and excluded from their rites, they were
always particularly charming to him at this time; he and his household
received small courtesies and presents, just because he was outside.
-- E M Forster
 
K

Keith Thompson

E. Robert Tisdale said:
Keith said:
E. Robert Tisdale writes:
[...]
What does "rare" mean?
It appears that you can get a C99 conforming compiler
for just about every platform that C programmers target.
If you want to be *accurate*, you should say,
"C99 conforming implementations are ubiquitous."
I hardly think that they're "ubiquitous".
I know of some platforms
that are not likely *ever* to have a conforming C99 compiler
(though they're not platforms that most of you are likely to use),
and the most widespread C implementation, gcc, is not fully conforming
(for example, variable-length arrays, complex and imaginary support
and inline functions are still marked as "broken", even in gcc 4.0.0).

Please show us an example of how gcc support for variable-length arrays
is "broken".

I have no idea; I'm just going by the statement on their own web page.
 
K

Keith Thompson

Keith Thompson said:
I have no idea; I'm just going by the statement on their own web page.

I just checked the gcc 4.0.0 documentation. It says:

Variable-length automatic arrays are allowed in ISO C99, and as an
extension GCC accepts them in C89 mode and in C++. (However,
GCC's implementation of variable-length arrays does not yet
conform in detail to the ISO C99 standard.)

I didn't see any more details. If you're interested, perhaps you
could do some research yourself.

In any case, the details aren't really the point. The point is that
gcc is not a conforming C99 compiler; VLAs were just one of several
examples of non-conformance from
<http://gcc.gnu.org/gcc-4.0/c99status.html>. (I only posted a few.)

Do you claim that gcc is a conforming C99 compiler? (I know you've
said before that it's close enough for your purposes; that's not
helpful for the rest of us.)
 
E

E. Robert Tisdale

Keith said:
Keith Thompson said:
[...]
Please show us an example of how gcc support for variable-length arrays
is "broken".

I have no idea; I'm just going by the statement on their own web page.


I just checked the gcc 4.0.0 documentation. It says:

Variable-length automatic arrays are allowed in ISO C99, and as an
extension GCC accepts them in C89 mode and in C++. (However,
GCC's implementation of variable-length arrays does not yet
conform in detail to the ISO C99 standard.)

I didn't see any more details. If you're interested, perhaps you
could do some research yourself.

In any case, the details aren't really the point. The point is that
gcc is not a conforming C99 compiler; VLAs were just one of several
examples of non-conformance from
<http://gcc.gnu.org/gcc-4.0/c99status.html>. (I only posted a few.)

Do you claim that gcc is a conforming C99 compiler?
(I know you've said before that it's close enough for your purposes;
that's not helpful for the rest of us.)

How do you know that?
You can't even tell us what's broken.

Your posts seem to imply that complete compliance is important to you.
Can you provide *any* examples to support your point of view.
I submit that the broken C99 features in gcc
are no more important to you than they are to me.
 
K

Keith Thompson

E. Robert Tisdale said:
How do you know that?
You can't even tell us what's broken.

I see that you haven't bothered to answer my question.

Again, do you claim that gcc is a conforming C99 compiler? If so,
you're disagreeing with gcc's own documentation, and I'd say the
burden is on you to provide evidence that you're right and they're
wrong.
Your posts seem to imply that complete compliance is important to you.
Can you provide *any* examples to support your point of view.
I submit that the broken C99 features in gcc
are no more important to you than they are to me.

The point is your own statement upthread:

] If you want to be *accurate*, you should say,
] "C99 conforming implementations are ubiquitous."

If that's accurate, then either gcc is a C99 conforming implementation,
or the existing C99 conforming implementations other than gcc qualify
as "ubiquitous". I don't believe either of those statements is accurate.

An important point here is that gcc is a compiler, not an entire C
implementation. On many systems gcc depends on the native C runtime
library; many such libraries are not C99 conforming.
 
M

Mark McIntyre

On Thu, 05 May 2005 04:13:01 GMT, in comp.lang.c ,
ANSI's distribution method requires you to agree to a (somewhat
ludicrous) license that's more restrictive than copyright law, which is
perfectly legal.

IANAL but I don't think a country /can/ introduce a more restrictive
copyright law than the Hague Convention allows. Or rather, it can
introduce it, but its then in breach of international law. Mind you,
thats a big "so what" round here... :)
 
M

Mark McIntyre

Fair use does not mandate that the publisher make it convenient to
copy; it only limits what constitutes copyright infringement.

true. However if the delivery mechanism rendered fair use impossible,
then that'd be an issue.
And ANSI does not prevent copying. They disable one rather narrow
copying process (the copy-and-paste function when the document is
displayed by a renderer that respects the disable-copy function).
They can't stop you (programmatically) from retyping by hand and so
forth. Or from extracting the text from the PDF using something
other than Adobe Acrobat Reader.

true.
 
A

Arthur J. O'Dwyer

These days the RIAA and DMCA seem to be not considering "fair use" a
factor, so I guess that if there is an international agreement the US
aren't now part of it. Although since they only prevent you doing it by
a convenient method (copy & paste) they could claim that you have the
same right of "fair use" as if it were a printed version (do it by hand
or take a photocopy or screen-shot), they don't have to make it easy for
you to do it.

Something nobody's mentioned, which actually would be on-topic
/somewhere/ in the comp.* hierarchy, ;-) is that it's not that the
PDF is preventing you from copying bits of it. It's your PDF /reader/
software that's preventing copying. And if you get a free-as-in-speech
PDF reader, then you (presumably; untested but educated guess) won't
have those troubles. That may or may not explain why some people are
claiming their PDFs are copy-protected and others are saying theirs
aren't.

Way, way OT: Rep. Rick Boucher (D-Va.) has introduced a bill in the
U.S. House of Representatives trying to restore "fair use" to the DMCA.
(The name of the bill is misleading, IMHO, in order to sneak that goal
past industry lobbyists. I don't know how well that works in practice.)
See Section 5 of http://thomas.loc.gov/cgi-bin/bdquery/z?d109:hr01201:

-Arthur
 
E

E. Robert Tisdale

Keith said:
E. Robert Tisdale said:
Keith said:
Keith Thompson writes:
[...]
Do you claim that gcc is a conforming C99 compiler?
(I know you've said before that it's close enough for your purposes;
that's not helpful for the rest of us.)

How do you know that?
You can't even tell us what's broken.

I see that you haven't bothered to answer my question.

Again, do you claim that gcc is a conforming C99 compiler?

I *never* made any such claim.
If so, you're disagreeing with gcc's own documentation
and I'd say the burden is on you
to provide evidence that you're right and they're wrong.

That's a fallacious argument -- a "straw man".

http://www.don-lindsay-archive.org/skeptic/arguments.html#straw

I don't need to provide evidence
because I never disagreed with "gcc's own documentation".
Your remark is irrelevant.
Your posts seem to imply that complete compliance is important to you.
Can you provide *any* examples to support your point of view.
I submit that the broken C99 features in gcc
are no more important to you than they are to me.

The point is your own statement upthread:

] If you want to be *accurate*, you should say,
] "C99 conforming implementations are ubiquitous."

If that's accurate, then either gcc is a C99 conforming implementation,

I never made any such claim.
or the existing C99 conforming implementations other than gcc qualify
as "ubiquitous". I don't believe either of those statements is accurate.

I never claimed that gcc was conforming because it was "ubiquitous".

According to the American Heritage Dictionary of the English Language:
Fourth Edition. 2000:

http://www.bartleby.com/61/

ubiquitous
ADJECTIVE: Being or seeming to be everywhere at the same time;
omnipresent: ...

C99 conforming implementations certainly seem to be everywhere.
What did *you* think that ubiquitous meant?

Keith,

We are weary from your pedantry.
gcc -std=c99 works just fine for me.
I suspect that it works just fine for you too.
If you disagree, please show us just one example
of C90 or C99 conforming code
that you or any other C programmer should care about
that does not compile correctly with gcc -std=c99.

Perhaps some gcc gnuru can contrive an example
which exposes a defect in gcc -std=c99
but it doesn't matter unless some C programmer
actually writes code which relies upon the broken feature.
Your objection to gcc -std=c99
based upon *hypothetical* examples is unreasonable.
 

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
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top