Difference between C89 and C99?

K

Keith Thompson

E. Robert Tisdale said:
Keith Thompson wrote: [...]
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.

Finally, an answer. About half of your response could have been
replace by a simple "no".

Ok, so you don't claim that gcc is a conforming C99 compiler. I
didn't say that you did make such a claim; I asked whether you did.

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

The same thing everyone else thinks it means.

I use a number of systems on which gcc is the only available C compiler.

I use a number of other systems that have gcc and one or more other C
implementations that are not claimed to be conforming.

There may be conforming C99 implementations that are *available* for
those systems. They may be available only for a non-zero monetary
price, and I'm not generally in a position to acquire or install them.
Keith,

We are weary from your pedantry.

"We"? For whom do you speak?

If conforming C99 compilers were "ubiquitous", as you claim, then I
could safely use the C99 standard as a general guide for C
programming, and I could use any features I like and expect the
resulting code to be portable to all platforms I might care about.
I can do that for C90; I can't (yet) do that for C99.
 
E

E. Robert Tisdale

Keith said:
If conforming C99 compilers were "ubiquitous", as you claim,
then I could safely use the C99 standard
as a general guide for C programming
and I could use any features I like
and expect the resulting code to be portable
to all platforms I might care about.
I can do that for C90; I can't (yet) do that for C99.

Why can't you do that for C99 yet?
Can you show us a C code that you care about
that won't compile with gcc -std=c99
or some other C99 compliant implementation
for your target platforms?
If you can't, I must conclude that
you are simply describing an unfounded superstitious belief.
 
K

Keith Thompson

E. Robert Tisdale said:
Why can't you do that for C99 yet?
Can you show us a C code that you care about
that won't compile with gcc -std=c99
or some other C99 compliant implementation
for your target platforms?
If you can't, I must conclude that
you are simply describing an unfounded superstitious belief.

% uname -srmp
SunOS 5.9 sun4u sparc
% gcc --version | head -1
gcc (GCC) 4.0.0
% cat tmp.c
#include <stdint.h>
int main(void)
{
intmax_t n;
return 0;
}
% gcc tmp.c
tmp.c:1:20: error: stdint.h: No such file or directory
tmp.c: In function 'main':
tmp.c:4: error: 'intmax_t' undeclared (first use in this function)
tmp.c:4: error: (Each undeclared identifier is reported only once
tmp.c:4: error: for each function it appears in.)
tmp.c:4: error: parse error before 'n'
% find /usr/include -name '*stdint*'
%
 
C

Chris Croughton

% uname -srmp
SunOS 5.9 sun4u sparc
% gcc --version | head -1
gcc (GCC) 4.0.0
% cat tmp.c
#include <stdint.h>
int main(void)
{
intmax_t n;
return 0;
}
% gcc tmp.c
tmp.c:1:20: error: stdint.h: No such file or directory
tmp.c: In function 'main':
tmp.c:4: error: 'intmax_t' undeclared (first use in this function)
tmp.c:4: error: (Each undeclared identifier is reported only once
tmp.c:4: error: for each function it appears in.)
tmp.c:4: error: parse error before 'n'
% find /usr/include -name '*stdint*'
%

Where the library is concerned, printf seems to often be 'broken' as far
as C99 is concerned, often not supporting modifiers ll, j, z and t and
the a,A conversion specifier. A lot of the new functions don't exist in
existing libraries either (snprintf(), lots of floating point stuff...)
and gcc uses the system library.

Installing another compiler or library is often (usually in my
experience) not an option in a commercial environment, the code has to
work with whatever compiler the site or customer uses. On many sites
developers aren't allowed to install other software even for their own
use.

Chris C
 
A

Alan Balmer

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... :)

I think you mean the Berne convention. It's not an international law,
just an agreement among the countries that signed it. The US is a
signatory.
 
M

Michael Wojcik

C99 conforming implementations certainly seem to be everywhere.

Only to a fool.

Name the C99-conforming implementation on the system I am using right
now. I'll give you any number of guesses; since there isn't one, it
doesn't matter how many you try.

One counterexample suffices to demonstrate that they are not, in
fact, everywhere.

--
Michael Wojcik (e-mail address removed)

Most people believe that anything that is true is true for a reason.
These theorems show that some things are true for no reason at all,
i.e., accidentally, or at random. -- G J Chaitin
 
C

Chris Hills

Michael Wojcik said:
That's completely beside the point. "There are no conforming
compilers" is wrong. Period.


Comeau + Dinkumware can be used on various mainstream systems.


How about 8 and 16 bit MCUs? eg the 8051,

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

Keith Thompson

Alan Balmer said:
I think you mean the Berne convention. It's not an international law,
just an agreement among the countries that signed it. The US is a
signatory.

Which is pretty much what international law is (but IANAIL).
 
M

Mark McIntyre

I think you mean the Berne convention.

you're absolutely right, no idea why I put hague...
It's not an international law,
just an agreement among the countries that signed it. The US is a
signatory.

whats an international convention if not international law...
 
A

Alan Balmer

you're absolutely right, no idea why I put hague...


whats an international convention if not international law...

International != Universal :)

I took your use of "international law" to imply that any country would
be bound by the convention. Actually, only its signatories are so
bound, of course.

It's been a while since I read the Berne Convention, and I'm not at
all clear as to what further restrictions could be legally applied. It
does seem that not only the US, but other countries are currently
trying to impose restrictions that aren't in the Convention. In
particular, I think the "fair use" rules are quite clearly violated at
least in spirit by some of those restrictions.

I don't think that the DMCA, for example, has been examined by the
courts at the highest level (though I might not have been paying
attention.) In fact, I think some recent court decisions have weakened
it somewhat. Now you've got me interested again - I'll have to do some
research.
 
S

Stephen Sprunk

Because quite a lot of information is lost in translation -- much of the
typesetting is significant (e.g., italicized terms are definitions) and
the mathematical equations are not easily represented in plain text.
Although it would certainly be possible to create a usable text version,
it would require far more work than the volunteer editor is willing to
expend.

If that is the only reason, they could have easily converted the
document to HTML or RTF or even MS Word. Anyone who didn't care about
the formatting could reduce to text if desired.

Follow the money. It's about trying to prevent illegal copying, and
preventing legal copying is an unfortunate side effect.

S
 
K

Keith Thompson

Stephen Sprunk said:
If that is the only reason, they could have easily converted the
document to HTML or RTF or even MS Word. Anyone who didn't care about
the formatting could reduce to text if desired.

Follow the money. It's about trying to prevent illegal copying, and
preventing legal copying is an unfortunate side effect.

How does distributing it in PDF prevent illegal copying? If I were so
inclined, I could easily put a copy of the C standard on a web page or
an ftp site (or via BitTorrent, or whatever).
 
M

Michael Wojcik

How about 8 and 16 bit MCUs? eg the 8051,

How about them? What is your point? You quote eleven lines of text
from various posts, add a tangential question and a phrase that's not
even a complete sentence. Is that supposed to be some sort of
argument? It's barely coherent.

Let us suppose, for the sake of argument, that you meant "are there
conforming C99 implementations for 8- and 16-bit MCUs, such as the
8051?" I have no idea. The question is of, at best, only academic
interest to me. It's also irrelevant to my position, which is that
there are some implementations for some platforms which do claim to
conform to C99. And it's equally irrelevant to that last point you
quoted; the existence of "mainstream systems" (however defined) on
which Comeau + Dinkumware is not supported in no way refutes the
claim that there exist (other) mainstream systems on which that
combination *is* supported.


--
Michael Wojcik (e-mail address removed)

I said, 'I need to put my soul into my work and it is well known that
computers haven't got a soul.' My father said, 'The Americans are working
on it.' -- Sue Townsend, _The Secret Diary of Adrian Mole, Aged 13 3/4_
 
L

lawrence.jones

Stephen Sprunk said:
If that is the only reason, they could have easily converted the
document to HTML or RTF or even MS Word.

You seem to have an interesting definition of "easy".

-Larry Jones

I think your train of thought is a runaway. -- Calvin's Mom
 
C

Chris Croughton

Yes, that $18 sure adds up quick.

Since I have 6 computers on my system at home, let alone when I want to
use it at customer sites, it certainly does. For a company, it only
takes about 20 employees to get to where buying the book is cheaper...
Yes, there are significant changes. No, I don't know of any exhaustive
list.

Any list at all? Are they actually 'significant' to anyone except
academics?

Chris C
 
L

lawrence.jones

Chris Croughton said:
Any list at all? Are they actually 'significant' to anyone except
academics?

I don't know of any list at all. Significance is, to some extent, in
the eye of the beholder, but I believe that some of them are of more
than academic interest. I can send you the ~23,000 lines of diffs in
the troff sources if you'd like to wade through them and decide what's
significant and what isn't. :)

-Larry Jones

I think my cerebellum just fused. -- Calvin
 
C

Chris Croughton

I don't know of any list at all. Significance is, to some extent, in
the eye of the beholder, but I believe that some of them are of more
than academic interest. I can send you the ~23,000 lines of diffs in
the troff sources if you'd like to wade through them and decide what's
significant and what isn't. :)

23klines of diffs between the last draft and the released version? That
sounds like a recipe for releasing errors. When I release programs the
/only/ difference between the latest tested version and the released one
is the version number -- and even changing that has been known to cause
errors -- for a printed document the "boilerplate" might be added as
well, like title/copyright/contents/index pages.

If they are like other diffs of text sources then most of them will be
meaningless differences in spacing and line wrapping. I have yet to
find (or write) a diff which recognises the significant parts and throws
away the rest (such a beast would need to know about [gnt]roff, various
flavours and derivatives of TeX, and preferable at least the major
programming languages, to be useful). If you sent me the 'raw' troff
sources I could try writing one, though <g>...

But isn't there some version control which has a "changes since last
document" in English? My code (both at work and at home) has a list of
reasons for change in English (not just the diffs), at work I'm not
allowed to check in a revised version without a list of what I've done
and why (and it is reviewed to make sure that the changes in the code
match the description). Do standards bodies not operate such a scheme?

(I've never been on (in?) a standards group, so I don't know whether
there is any standard for writing and changing standards. I may be
naive in expecting it...)

Chris C
 

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,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top