C 99 compiler access

E

E. Robert Tisdale

Malcolm said:
The difference is that C99 was designed by a standards body.
There is no point in having a "standard" that is not widely implemented.
So the present situation is very undesireable, but it is largely ANSI's fault,
because the extensions were neither so minimal that they could be
trivially implemented (a #define for bool, a vnsprintf() function, etc)
nor were like the C++ extensions,
very far reaching and offering greatly enhanced functionality.
Instead, we had a lot of feature of dubious use
which require rewrites of the compiler.
For instance, variables can now be declared anywhere which seems to be
just a way of making code less organised and harder to read,
and variable arrays are allowed.
Since a variable length array cannot fail,
and the programmer won't know the array length at run time,
this is asking for a security exploit.

Your indictment of ANSI seems to imply that
it is taking a lot longer for C compiler developers to implement
the C99 standard than it took to implement the C89 standard
and that the blame for the delay belongs [mostly] with ANSI
and *not* with the C compiler developers.
 
C

CBFalconer

Mabden said:
.... snip ...

Oh boy, I get to read another "E. Robert Tisdale" is a troll
message.

Q. When does pointing out a troll become trolling?
A. Last year.

Everyone knows that statements made on the Internet should be
taken with a grain of salt. M'kay. Get over it. I can find the
kill button all by myself, so STFU.

Unfortunately (or fortunately) there are always newbies appearing
here. Without periodic warnings they would have no idea who
should be listened to and who should not. You may note that not
all of his postings are so marked, because he does occasionally
say something that is not in error.
 
A

Arthur J. O'Dwyer

]
variable arrays are allowed. Since a variable length array cannot fail,
and the programmer won't know the array length at run time, this is
asking for a security exploit. ^^^^^^^^^^^

Nit: ITYM "at compile time."

I just checked N869, and I don't see any provision for the failure
of VLA allocation either. Does that mean that if the programmer writes

#include <stdlib.h>
int main(int argc, char **argv)
{
int foo[atoi(argv[1])];
}

that will simply invoke undefined behavior if the user enters, say,
'./a.out 1000000' and there's not enough memory to satisfy such a
request?

That does seem like a weird "feature" to add to C99, then, if it
can just fail randomly with no chance of recovery! :(

[xpost to c.s.c added]

-Arthur
 
M

Mabden

CBFalconer said:
Unfortunately (or fortunately) there are always newbies appearing
here. Without periodic warnings they would have no idea who
should be listened to and who should not.
You may note that not all of his postings are so marked,
because he does occasionally
say something that is not in error.

How benign. Praise you.

I have seen more garbage disposing him (to coin a phrase) than any kind of
erroneous posts and numerous harping on a slight misspelling or nuance that
does not detract from the actual point he was making - just to then add "is
a known troll" - is not helpful to the discussion so why are you "helping".
It has gotten really old, since I find no problem with the post in question,
only with the (mandatory) follow-up posts. Take a breath and google some
responses in the last 3 months. They have no content at all. Just a warning
about trolls. People understand (or come to understand) that the Internet is
an open forum and any maniac may post. Little girls will be seduced, people
will be electrocuted, dogs will be badly trained - all by following advice
from the Internet.

Sorry for the rant, but I am tired of the follow-ons and if you continue it
you will also find the tedium of my follow-ons saying please stop. Of course
there are many of you and only one of me, so I am easier to killfile.
Hmmmm... I will have to think about this.

But please stop. People are able to decide who to listen to, and one person
will not the world change. Or change the world, but it sounded cooler in my
head the other way.
 
J

Jack Klein

]
variable arrays are allowed. Since a variable length array cannot fail,
and the programmer won't know the array length at run time, this is
asking for a security exploit. ^^^^^^^^^^^

Nit: ITYM "at compile time."

I just checked N869, and I don't see any provision for the failure
of VLA allocation either. Does that mean that if the programmer writes

#include <stdlib.h>
int main(int argc, char **argv)
{
int foo[atoi(argv[1])];
}

that will simply invoke undefined behavior if the user enters, say,
'./a.out 1000000' and there's not enough memory to satisfy such a
request?

That does seem like a weird "feature" to add to C99, then, if it
can just fail randomly with no chance of recovery! :(

[xpost to c.s.c added]

Why so strange? This program can fail:

#include <stdio.h>
int main(void)
{
int foo [1000000];
foo [999999] = 42;
printf("%d\n", 42);
}

Since an array of one million ints has a size greater than 65,535
bytes, no implementation is required to successfully translate and
execute it.
 
D

Douglas A. Gwyn

Arthur said:
int foo[atoi(argv[1])];

It's essentially like any other kind of potential
stack overflow, and what occurs upon such overflow
is beyond the scope of the standard.

Malcolm's criticisms (which I saw only embedded in
a later response) were off the mark.
 
D

Dan Pop

In said:
No; undefined behavior does not require a diagnostic.
1.6 "Definitions of terms".


Yes. 3.6.6.4 "The return statement" says that reaching
a function's closing } is equivalent to executing a return
with no value. 2.1.2.2 "Hosted environment" says that if the
initial invocation of main() executes a return with no value,
the status returned to the host environment is undefined.
1.6 "Definitions of terms" says that using an indeterminately
valued object produces undefined behavior.

If the indeterminately valued object is used *by the C program*.
If you can argue that the host environment's use of the
termination status isn't a "use," you can probably get along
well with Bill Clinton.

1. The termination status is not a C object. It's not even a value with
a C type.

2. Since this use of the termination status is outside of the execution
of the C program (the execution of the C program has terminated by
then), the text of the C standard does not apply to it: it is beyond
the scope of the C standard.

Before being sarcastic, make sure that your brain is fully engaged ;-)

Dan
 
A

Alan Balmer

But please stop. People are able to decide who to listen to, and one person
will not the world change.

Yes, you are free to read or not read any post here, as are the rest
of us. If you find the writings of any particular person too obnoxious
or tedious, you can killfile them, as I have long ago killfiled Mr.
Tisdale. I am on the verge of finding your writings tedious, as well.
 
M

Michael Wojcik

But please stop.

In this matter you appear to be in the minority of posters to c.l.c
who have expressed an opinion; that being the case, I imagine you'll
have to come up with a stronger argument than "I don't like it".
People are able to decide who to listen to,

Yes. However, they have historically not been able to make that
decision well, absent any information about the person speaking.
Have people suddenly gained a magic ability to unerringly determine
the value of someone else's statements? I must have missed that.

Usenet is by its nature an antagonistic forum; it does not lend
itself to the gradual building of consensus. (Read some of the
academic work on discourse in this sort of environment if you're
curious why.) Public response is the only direct mechanism available
for vetting the ideas presented in unmoderated newsgroups. Asking
people to refrain from making such responses is tantamount to asking
them to reduce the information content of the group.

--
Michael Wojcik (e-mail address removed)

_
| 1
| _______ d(cabin) = log cabin + c = houseboat
| (cabin)
_| -- Thomas Pynchon
 
M

Mabden

Michael Wojcik said:
In this matter you appear to be in the minority of posters to c.l.c
who have expressed an opinion; that being the case, I imagine you'll
have to come up with a stronger argument than "I don't like it".


Yes. However, they have historically not been able to make that
decision well, absent any information about the person speaking.
Have people suddenly gained a magic ability to unerringly determine
the value of someone else's statements? I must have missed that.

Usenet is by its nature an antagonistic forum; it does not lend
itself to the gradual building of consensus. (Read some of the
academic work on discourse in this sort of environment if you're
curious why.) Public response is the only direct mechanism available
for vetting the ideas presented in unmoderated newsgroups. Asking
people to refrain from making such responses is tantamount to asking
them to reduce the information content of the group.

Understood, but I feel like I'm in a Monty Python skit at this point.
"An argument is a connected series of statements intended to establish a
proposition. It's not just saying, 'No it isn't.'"
"Yes it is."
"No, it isn't"

When some one makes a remark on the usenet it may be correct, it may be
false, it may be somewhere in between. You are free to correct the poster,
or ignore the error. But to just post to say, "This guy is a shithead" isn't
helpful. The messages I'm objecting to have no instructive or constructive
content other than "that guy is a shithead and everyone already knows it, so
I want to be first to say it again".

Just killfile him and YOU won't have to hear what he has to say, and the
rest of us can go on listening to whomever we choose.

Now, unfortunately for me, I don't wish to killfile the posters doing it
like CBF, yourself, etc. because they tend to have good comments once in a
while and that's why I read here. But they have this one-sided fight that
seems a little unreasonable to the casual reader of this newsgroup. Perhaps
ERT has mollified (does that mean lightened-up?) in his bad behaviour but he
really hasn't said anything trollish in the last 6 months that I have been
here.

Anyone (including yours truly) can be mistaken and pedantic about a point
they believe correct, and I believe I was called troll in one thread with
another gentleman. I learned a lesson about C through the conversation,
however, and there was no trolling going on, simply extensive requests for
clarification that ended in my enlightenment. So I have felt the sting of
the troll brush, and will probably feel it again for responding to this
post. That or a sock-puppet card. In any case, I am merely stating again,
for anyone still reading, that I don't find any recent posts by ERT to
display any trolling or inappropriate language, but I have seen such
behaviour in those following along behind him issuing harassing missives
behind his back EVERY TIME. That is a troll.

Killfile me if you want, but please killfile ERT first so I don't have to
read your flames about him anymore.
 
A

Allin Cottrell

Mabden wrote:

[ that he does not like to see E. Robert Tisdale called a troll ]

It seems to me that you can't have been reading this newsgroup very
long, or very carefully.

Of the messages I've seen, saying "So-and-so is a troll, disregard
him", over the last year or so, most have been from ERT himself, and
mostly they have been very silly: a troll accusation issued when
somebody says something he disagrees with.

ERT's latest foray strikes me as a case of (at least mild)
trolling. Not long ago here there was a serious discussion of the
shortcomings of C99 and the fact that mainstream C compilers do not
support it and do not seem in any hurry to support it. Then ERT
comes along and says, all innocent and without reference to the
previous discussion, "Hey, on my system I have a bunch of compilers
that support C99, why isn't everyone using it? Are they just
dragging their feet?"

Allin Cottrell
 
M

Mabden

Allin Cottrell said:
Mabden wrote:

[ that he does not like to see E. Robert Tisdale called a troll ]

ERT's latest foray strikes me as a case of (at least mild)
trolling. Not long ago here there was a serious discussion of the
shortcomings of C99 and the fact that mainstream C compilers do not
support it and do not seem in any hurry to support it. Then ERT
comes along and says, all innocent and without reference to the
previous discussion, "Hey, on my system I have a bunch of compilers
that support C99, why isn't everyone using it? Are they just
dragging their feet?"

Yes I saw that. He claims to work at JPL and has access to many machines of
all kinds that support C99.

I read how some people feel that C99 is not implemented as widely as it
should be. So what is wrong with all the C99 compiler implementations in
your view?
 
C

CBFalconer

Mabden said:
.... snip ...

I read how some people feel that C99 is not implemented as widely
as it should be. So what is wrong with all the C99 compiler
implementations in your view?

Back when C89/90 appeared, it was preceded by the appropriate
drafts. The prime market for C (and other) compilers then was
DOS. Among the main competitors were MS, Borland, Zortech,
Watcom, selling roughly in the $200 .. $1000 range. There had
been no standard, and the users demanded standards compliance.
There was fun and profit in supplying that demand.

Today by far the majority of C is developed on either GCC or MS
VC. Only gcc is making an effort to be C99 compliant, on
principle. There is no profit in it, and no overwhelming user
demand, thus no pressure. There is a relatively small market for
embedded cross compilers, some of which still sell for exorbitant
numbers. The chips their output runs on are often incapable of
handling a fully compliant C system, so the compilers do funny and
specialized things. Again, no pressure.

A third factor is the GUI. They are inherently system specific
and have been deliberately made incompatible with standard
practice (at least in the case of MS, i.e. use of winmain, no
stdin/stdout). MS has no great interest in portable code.

15, 20, 25 years ago a good compiler, for any fairly popular
language or close approximation could earn the writer a good
living. Not so today.
 
F

Flash Gordon

Allin Cottrell said:
Mabden wrote:

[ that he does not like to see E. Robert Tisdale called a troll ]

ERT's latest foray strikes me as a case of (at least mild)
trolling. Not long ago here there was a serious discussion of the
shortcomings of C99 and the fact that mainstream C compilers do not
support it and do not seem in any hurry to support it. Then ERT
comes along and says, all innocent and without reference to the
previous discussion, "Hey, on my system I have a bunch of compilers
that support C99, why isn't everyone using it? Are they just
dragging their feet?"

Yes I saw that. He claims to work at JPL and has access to many
machines of all kinds that support C99.

I read how some people feel that C99 is not implemented as widely as
it should be. So what is wrong with all the C99 compiler
implementations in your view?

The fact that they don't exist?

Seriously, only a very few of the implementations used by people other
than ERT claim C99 conformance but nearly all of them claim C89
conformance when invoked correctly.

MS have stated that they do not intend to implement C99 thus eliminating
a significant (although not necessarily the largest) part of the market.

gcc has not fully implemented the language parts of C99 (the libraries
are separate) thus eliminating another large segment.

I currently develop SW for 4 OSs and don't have even 1 C99 compliant
compiler. Admittedly 3 of those are *nix, but I am including both native
compilers and gcc on all the systems in my count.

Also, you should note that ERT has not told us what these compilers are
that he claims to have that support C99. Since he won;t tell us the
claim cannot be verified and is therefor highly suspect.
 
D

Dan Pop

In said:
Allin Cottrell said:
Mabden wrote:

[ that he does not like to see E. Robert Tisdale called a troll ]

ERT's latest foray strikes me as a case of (at least mild)
trolling. Not long ago here there was a serious discussion of the
shortcomings of C99 and the fact that mainstream C compilers do not
support it and do not seem in any hurry to support it. Then ERT
comes along and says, all innocent and without reference to the
previous discussion, "Hey, on my system I have a bunch of compilers
that support C99, why isn't everyone using it? Are they just
dragging their feet?"

Yes I saw that. He claims to work at JPL and has access to many machines of
all kinds that support C99.

If you're not a patent idiot (or a troll on your own) you must be an
alternate net identity of Tisdale. ERT has explicitly admitted, in a
subsequent post, that none of the compilers he has access to is a
conforming C99 compiler, they merely support all the C99 features *he*
needs. This doesn't make them C99 compilers and this is far from
justifying the usage of C99 features in *portable* C code (which
happens to be the main focus of this newsgroup).

Dan
 
A

Alan Balmer

Allin Cottrell said:
Mabden wrote:

[ that he does not like to see E. Robert Tisdale called a troll ]

ERT's latest foray strikes me as a case of (at least mild)
trolling. Not long ago here there was a serious discussion of the
shortcomings of C99 and the fact that mainstream C compilers do not
support it and do not seem in any hurry to support it. Then ERT
comes along and says, all innocent and without reference to the
previous discussion, "Hey, on my system I have a bunch of compilers
that support C99, why isn't everyone using it? Are they just
dragging their feet?"

Yes I saw that. He claims to work at JPL and has access to many machines of
all kinds that support C99.
Did he name those machines, and the C99 implementations that he claims
exist?
I read how some people feel that C99 is not implemented as widely as it
should be. So what is wrong with all the C99 compiler implementations in
your view?

Mostly that with few exceptions, they don't exist. The only compiler
I'm aware of which claims C99 conformance is Comeau, though many
compilers provide support for some of the features. The probability is
that Mr. Tisdale doesn't know what he's talking about, or is simply
trolling, or both. We have seen many examples of all three cases.
 
C

Chris Hills

E. Robert Tisdale said:
Your indictment of ANSI

It was not an indictment of ANSI.... ANSI is only one of a large number
of National Bodies that make up the ISO WG14 who produce the C standard.
seems to imply that
it is taking a lot longer for C compiler developers to implement
the C99 standard than it took to implement the C89 standard
and that the blame for the delay belongs [mostly] with ANSI
and *not* with the C compiler developers.

Well ISO have produced the standard the compiler writers have to work
to. The simpler the standard the easier it is to do.

The compiler writers are (on the whole) commercial if the world really
demanded a C99 compiler the would be more likely to do them faster.

I think it is the complexity coupled with the lack of requirement for a
C99 compiler that is the problem. If there was an industrial/commercial
requirement that we all use C99 compilers they would all be C99
compilers.

There is no black and white in this.

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

E. Robert Tisdale

Chris said:
IE. Robert Tisdale writes


It was not an indictment of ANSI....
ANSI is only one of a large number of National Bodies
that make up the ISO WG14 who produce the C standard.

Malcolm mentions only ANSI.
What fraction of the blame belongs to these other "National Bodies"?
And who are they?
seems to imply that
it is taking a lot longer for C compiler developers to implement
the C99 standard than it took to implement the C89 standard
and that the blame for the delay belongs [mostly] with ANSI
and *not* with the C compiler developers.

Well, ISO [has] produced the standard
[that] the compiler writers [must] work to.
The simpler the standard the easier it is to do.

The compiler writers are, on the whole, commercial. If the world really
demanded a C99 compiler, they would be more likely to do them faster.

So the "world" is to blame for the delay in full compliance?
I think it is the complexity coupled with
the lack of requirement for a C99 compiler that is the problem.
If there was an industrial/commercial requirement
that we all use C99 compilers, they would all be C99 compilers.

So C99 is the standard that nobody wanted?
 
D

Dan Pop

In said:
I think it is the complexity coupled with the lack of requirement for a
C99 compiler that is the problem. If there was an industrial/commercial
requirement that we all use C99 compilers they would all be C99
compilers.

You can safely drop the complexity bit from the picture: two tiny
businesses, Comeau and Dinkumware have produced an implementation
claiming C99 conformance since quite a while. The bigger vendors could
have done it a lot faster.

The real reasons are:

1. Lack of interest from the C community at large. The development of
C99 was mostly politically driven and little attention was paid to
what the C programmers actually needed/wanted. GNU C extensions of
proven value have been completely ignored, but we've got plenty of
Fortran features with little relevance to the main C problem domains.

2. C99 features conflicting with existing C89 extensions of many
implementors. The implementors are reluctant to break their users'
code by implementing the C99 semantics of the same feature. See an
older discussion about why GNU C people don't want to change their
compiler according to C99. gcc got quite close to C99 conformance
when version 3.0 was released (over three years ago), but didn't make
any significant progress ever since...

As a result, most implementations have C99 extensions, but this doesn't
help people writing portable code, as there is no commonly supported
subset of C99 (with the possible exception of // comments).

Dan
 
J

James Kuyper

E. Robert Tisdale said:
Chris Hills wrote: ....
Malcolm mentions only ANSI.
What fraction of the blame belongs to these other "National Bodies"?

ANSI has always played a disproportionately large role in the
development of the C standard, but I don't know how to determine a hard
number describing that disproportion.
And who are they?

The ISO C committee membership consists of representatives of various
"National Bodies" - each one is responsible for technical standards in
one nation, just as ANSI responsible for technical standards for the
United States.

....
So the "world" is to blame for the delay in full compliance?

Yes. By "the world", what is meant is people who purchase compilers. If
those people really demanded C99 compliance, and refused to purchase
non-compliant compilers, the compiler vendors would rush to accommodate
them. Since there's been no strong demand for C99 compliance, it has
come far more slowly.
 

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

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
EmeliaBryc

Latest Threads

Top