C 99 compiler access

K

Keith Thompson

Douglas A. Gwyn said:
My point was that the 1999 standard is playing a role in the
evolution of C compilers.

Agreed. Even if you can't assume that a given implementation will
support, say, complex numbers, it's probably safe at this point to
assume that an implementation that does support them will do so in a
manner consistent with the C99 specification.
It is unrealistic to expect fully
conforming implementations on day 1 of the standard.

That's a straw man. Nobody expects fully conforming implementations
on day 1 of the standard. A lot of us expected more conforming
implementations that we have on day 1740 of the standard (if I've done
the math right). (And the reasons for that have been discussed at
length here.)

I suspect the best way to improve the situation would be to devote the
necessary resources to make gcc support C99 at least as well as it
currently supports C90. If that happened, other vendors might feel
more pressure to be gcc-compatible than they now feel to be
C99-compatible.
 
C

CBFalconer

Douglas A. Gwyn said:
No, in fact historically compiler validation has been done by
profesional validation services, and not for free. The U.S.
government purchased a validation suite for use in
validating Federal C compiler procurements against the
initial C FIPS.

So what? The presence of a free suite would result in many users
checking their system, and complaining about failures. It would
advance the cause of C99 compliance. It could be revised for C09
or whatever, and aid in promulgating any future versions. An open
source style licence could maintain control. Even if the suite
has failings, such would be published and generally known, and
future revisions would incorporate corrections.

The presence of the Pascal suite in 1980 for the cost of media
certainly aided in compliance by most. Borland being the glaring
exception.
 
J

James Antill

This may be the wrong venue in which to ask, but how many
programmers really use the GNU extensions?

Apart from a very few examples of "GCC only" software, most software I've
seen uses extensions that can easily be switched off. For example things
like putting "__attribute__ ((__format__ (__printf__, x, y)))" on your
printf like functions, which you can then turn off if you aren't
compiling with GCC.
 
C

Chris Hills

Douglas A. Gwyn said:
My point was that the 1999 standard is playing a role in the
evolution of C compilers. It is unrealistic to expect fully
conforming implementations on day 1 of the standard.

However we are now 4 years down the line. Not "day 1" As has been
pointed out one compiler is C99 ( The tasking one and a couple of
smaller players) so it is possible to do. However there seems to be no
commercial impetus to do it.

If C99 was really a requirement anywhere they would all be producing C99
compilers.

Somehow we need to generate that feeling amongst programmers that it is
important.

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

Chris Hills

Mabden said:
So I can go back to my world of K&R2 and tell Keith and Dan to stuff it?
;-)

Probably, unfortunately.

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

Chris Hills

CBFalconer said:
That in turn requires a freely (in practice) available standard
test suite for evaluation purposes. Then every purchaser can
check compliance.

The standard is freely available from a multitude of sources.. The
recognised test suites are not. they cost a lot of money. However there
is a lot of work in them.
The suite should have various levels. To do anything it must use
at least getchar and putchar with stdin and stdout. After that
levels can check compliance with each possible #include of
standard headers.

See Plum-Hall and Perennial.


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

Chris Hills

CBFalconer said:
So what? The presence of a free suite would result in many users
checking their system, and complaining about failures.

No it wouldn't. No one is asking for ISO-C compliance much anyway let
alone testing it. There are a few fields where they do look at the
compiler but these tend to be on micros where there are extensions and
you would not run it in ISO-C mode anyway even if it could do it.
It would
advance the cause of C99 compliance. It could be revised for C09
or whatever, and aid in promulgating any future versions. An open
source style licence could maintain control. Even if the suite
has failings, such would be published and generally known, and
future revisions would incorporate corrections.

OK... you write it and post it here.
The presence of the Pascal suite in 1980 for the cost of media
certainly aided in compliance by most. Borland being the glaring
exception.

And their compiler became Delphi. AFAIK Borland had one of the more
successful Pascal compilers.



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

Chris Hills

Allin Cottrell said:
Surely this is putting the chicken before the horse.

The following is my analysis. It is not based on scientifically
validated evidence and may be wrong.

Around the time when the first C standard was introduced, C was a
very popular programming language. The C world had a strong reason
to avoid the proliferation of dialects and the standard was
welcome. Compiler vendors had a strong incentive to produce
standard-compatible compilers.

So far so good..
By the time C99 came out, C had lost a fair amount of ground to
C++ and Java (and now it, and/or the latter languages, are losing
ground to C#). Microsoft has no particular reason to invest a lot
of resources in a C99 compiler, since it has hitched its fortunes
to C# and .NET.

Yes.
Nonetheless, C remains the lingua franca of open-source programming.
I suspect that the great bulk of newly-written C code is open
source.

Not by a long long way... most of the C programming is in the embedded
world where they use a lot of commercial compilers because GCC is not
efficient enough.
In that context, people are mostly compiling it with gcc,
so the relationship between gcc and C99 is of key importance.
But as Dan has said, C99 to a large extent reinvents wheels that
were already available as gcc extensions. Hence C99 is in
trouble.

I have heard it said that C will tend to the GCC "standard" because it
is the most common single version on many platforms and targets.



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

Chris Hills

CBFalconer said:
If you can implant the idea in GWBs head, he can then incarcerate
any who fail to comply in the Gitmo gulag forever. You have about
2 months. :)

Seriously, it means some form of legality. Such as allowing
conformance with the standard to be a defence against certain
liabilities. That also requires insisting that software vendors,
contractors, etc. assume liability for their products. Similarly
hardware. My head hurts.

I think I said way back in this thread (and in several articles in
magazines over the years) that standardisation and improvements in Sw
engineering will come about via the legal and insurance professions not
the software industry.

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

Chris Hills

Douglas A. Gwyn said:
Many people would find that grounds for switching to
another vendor with a better appreciation of standards.
I am confused.. the USERS of the compiler were saying "the ISO committee
had got it wrong" because the standard was not tracking their compiler
which should be used as the reference....

The user in question was using an MS VC++ compiler to write and test
embedded code and wondered why it did not work when they tried to re-
compile it with an 8-bit embedded compiler....

In other words there are many users out there who think the standards
committee should be writing the standard to fit the compilers! Where the
compiler and standard disagree the standard is wrong.

So how do you sell the importance of C99 to people like that and there
are a LOT of them.

What was your comment about the vendor meant to mean? There wan no
vendor mentioned in the quote.



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

Scott Robert Ladd

So what? The presence of a free suite would result in many users
checking their system, and complaining about failures. It would
advance the cause of C99 compliance. It could be revised for C09
or whatever, and aid in promulgating any future versions. An open
source style licence could maintain control. Even if the suite
has failings, such would be published and generally known, and
future revisions would incorporate corrections.

What economic incentive is there for someone to develop a "free" C test
suite? For that matter, who is going to pay for development of a C99
compiler?

It simply isn't going to happen. People developing "free" software are
content with GCC, which does a fairly good job of approaching C99
compliance -- in comparison to most commercial compilers, that is. If GCC
is to attain full C99 compliance, someone is going to have to fund it (or
find a lot of available graduate students?)
The presence of the Pascal suite in 1980 for the cost of media
certainly aided in compliance by most. Borland being the glaring
exception.

More code was written in Borland Pascal/Delphi than in any other
dialect of Pascal, including Standard Pascal.

Beyond the numerical community (of which I am one), most programmers would
be hard-pressed to find anything in C99 that is a "must have" -- and as
such, there is no demand for C99 compilers.

If C99 *does* define non-numeric "must have" features (and I have
reviewed the Standard extensively), then those who want C99 compilers need
to do a bit of evangelizing.
 
D

David Hopwood

Douglas said:
Actually it is to allow *parametric* array sizes,
not *arbitrarily large* sizes.

I meant what I said. The *main point* of using VLAs is to allocate objects
of arbitrary sizes. If you have a fixed bound on the size that is small
enough, you don't need to use a VLA.
> Even if the entire
> app were coded using constant, largest supported
> sizes for every array, in general you still wouldn't
> know whether the stack will overflow at run time,
> unless you do careful analysis (and happen to have
> an algorithm that is not too dynamic).

How difficult it is to rigorously prove that a program does not cause a
stack overflow is not the issue here. For some purposes, testing at the
maximum recursion depth is sufficient. A program that uses arbitrary-size
VLAs *will* fail whenever it allocates a sufficiently large VLA. That in
itself is sufficient reason not to use them.

David Hopwood <[email protected]>
 
K

Keith Thompson

Chris Hills said:
The standard is freely available from a multitude of sources.. The
recognised test suites are not. they cost a lot of money. However there
is a lot of work in them.

If the standard is freely available, I wasted $18. Are you referring
to the draft versions?
 
D

Douglas A. Gwyn

Keith said:
Agreed. Even if you can't assume that a given implementation will
support, say, complex numbers, it's probably safe at this point to
assume that an implementation that does support them will do so in a
manner consistent with the C99 specification.

Yes, that is a good example. Similarly for the new
math functions now being considered for C++ as well
as C; it is much better for apps that need these to
use a *single* interface to invoke them than to have
be be adapted to each new platform that comes along.
I suspect the best way to improve the situation would be to devote the
necessary resources to make gcc support C99 at least as well as it
currently supports C90. If that happened, other vendors might feel
more pressure to be gcc-compatible than they now feel to be
C99-compatible.

That is a good point.
 
D

Douglas A. Gwyn

Scott said:
It simply isn't going to happen. People developing "free" software are
content with GCC, which does a fairly good job of approaching C99
compliance -- in comparison to most commercial compilers, that is. If GCC
is to attain full C99 compliance, someone is going to have to fund it (or
find a lot of available graduate students?)

This reminds me of a complaint I have with "the system"
that we currently have, in which *nobody seems to have
"official" responsibility for seeing that things that
ought to be done are done*. I have noticed this in
many areas, for example:
- checking standards conformance
- archiving equipment technical documentation
- archiving system software
- documenting data formats
- overseeing national intelligence
- declassifying no-longer-sensitive information

Now of course there are *some* official systems that
are supposed to help with *some* of this, for example
*some* products, mainly consumer items, undergo *some*
official testing against safety standards, and the (US)
Freedom of Information Act is supposed to help with that
last bullet. But in actuality these things are done
minimally or not at all, even when it is in the evident
best commercial or political interests of the parties
who are in the best position to do the job.

Consequently, what little is done in such areas depends
on the effort of concerned volunteers, who often are not
in a very good position to to the job right (for example,
may not have access to a complete set of documentation).
I chose the above list since I have recently been
involved in them, but as I indicated it mostly has been
done without the encouragement or support of my employer.

My father used to blame that kind of shortsightedness on
management having been taught by the likes of the
Harvard Business School, and I can't say that he was
wrong about that..
 
D

Douglas A. Gwyn

Chris said:
I am confused.. the USERS of the compiler were saying ...

Sorry, I misread it in context as saying that some
compiler vendors were encouraging that attitude.
In other words there are many users out there who think the standards
committee should be writing the standard to fit the compilers!

Yes, that kind of problem has existed "forever".
It is a matter of education, not of standards.
So how do you sell the importance of C99 to people like that and there
are a LOT of them.

Until they are educated about the value of
standards *and why as programmers they should
conform to them as much as possible*, they
aren't going to appreciate C99's standardizing
additional features that they have a good use
for.
 
B

Brian Inglis

However we are now 4 years down the line. Not "day 1" As has been
pointed out one compiler is C99 ( The tasking one and a couple of
smaller players) so it is possible to do. However there seems to be no
commercial impetus to do it.

If C99 was really a requirement anywhere they would all be producing C99
compilers.

Somehow we need to generate that feeling amongst programmers that it is
important.

You have to create marketing benefits for vendors, who will sell to
managers, who will tell programmers what is important to them.
 
R

Richard Kettlewell

Chris Hills said:
If C99 was really a requirement anywhere they would all be producing
C99 compilers.

Somehow we need to generate that feeling amongst programmers that it
is important.

I'd use C99 language features like designated initializers at work if
all the compilers we build with supported them; but only if they *all*
did, since otherwise I'd have to come up with a workaround for
everything else and there'd be no point using the new feature in the
first place. So there is a bootstrapping problem.

Library features are easier to start using before the implementors
have all caught up as sometimes you can do your own version for
obsolete platforms.
 
D

Dan Pop

In said:
As I stated in my previous posting on the subject, this is not an
accurate representation of the reasons behind the status of C
standards implementation in GCC.

Each person somewhat connected to the gcc project has his own opinions on
this issue, as seen over the years, when this topic is discussed.

What is a fact is that most gcc issues are related to conflicts between
GNU C and C99 for the same feature, not for missing support for C99
features with no conflicting GNU C equivalent.
GCC does not have a conforming C90 implementation either. I have been

The gcc documentation claims otherwise.

Dan
 
D

Dan Pop

In said:
The C99 implementation could be completed in a few months. (That is
for targets with sane floating-point hardware; not 387 floating point
on x86 which makes it hard to do computations in the range and
precision of float / double or round those done in long double to the
range and precision of float / double without storing to memory.)

Any chance to get -ffloat-store to solve this issue reliably? Right now,
it only fixes *some* precision-related issues.

Dan
 

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
474,146
Messages
2,570,832
Members
47,374
Latest member
EmeliaBryc

Latest Threads

Top