C Compilers

S

Seebs

I don't know if this is OT or not but I recently downloaded lcc-win for
my XP. I don't know how much I will use it but is it a full C99 compiler?

I would guess not, just because I'm not sure that I've yet seen any full
C99 compilers. It might well be good enough that you'll never notice any
gaps.

-s
 
P

Paul Richards

Bill said:
I don't know if this is OT or not but I recently downloaded lcc-win
for my XP. I don't know how much I will use it but is it a full C99
compiler?

Bill

Have a look at Pelles C - this seems to have a pretty full
implementation of C99, and it's free.
 
C

Chris H

Richard Heathfield said:
As far as I can tell, its author has never formally claimed its
conformance with any ISO C Standard, either C90 or C99.

It matters not what the author claims but what the tests show.

AFAIK there are only 6 fully C99 compliant compilers and none of these
are mainstream or on a PC platform.
 
F

Flash Gordon

Chris said:
It matters not what the author claims but what the tests show.

If the author claims not to have finished implementing the standard then
the claim matters, and I'm fairly sure it was within the last month I
saw a post from Jacob talking about what he had not finished implementing.

Also, I would not bother testing a compiler which does not claim compliance.
AFAIK there are only 6 fully C99 compliant compilers and none of these
are mainstream or on a PC platform.

Sounds about right for the last I heard.
 
B

Bill Cunningham

I don't know if this is OT or not but I recently downloaded lcc-win for
my XP. I don't know how much I will use it but is it a full C99 compiler?

Bill
 
C

Chris H

Flash Gordon said:
If the author claims not to have finished implementing the standard
then the claim matters,

I agree. If the Author does not claim compliance then it is not really
fair to test it and shout "not-compliant"
and I'm fairly sure it was within the last month I saw a post from
Jacob talking about what he had not finished implementing.
Also, I would not bother testing a compiler which does not claim compliance.

I disagree. Most compilers are not ISO C 99 compliant. In the embedded
sector most are not fully ISO C 90 compliant either.

Testing for compliance will show where they are and are not compliant.
However as long as they are not claiming compliance for areas where the
are not there is no problem. What testing does is confirm exactly how
the compiler performs.

There is no legal requirement for a fully compliant ISO C compiler.

Sounds about right for the last I heard.

What the testing does is confirm where it does and does not meet the ISO
C standard (and which version) It should also confirm any deviations
from the ISO C Standard. These deviations are usually in an appendix
of the compiler manual and testing should confirm this.

This is compiler *validation* but not certification. Thus the user
knows how the compiler will perform with the C syntax. However there is
a lot more to compiler testing that the language compliance test suites.

Most commercial compilers do have this testing and most non commercial
compilers don't for several reasons, the two industry standard language
test suites cost a lot of money (due to the immense amount of work
involved in them) and there are no other tests suites of comparable
standard available. It also requires other test and regression tests all
built to t the same standard (or higher) than the compiler.
 
C

Chris H

Richard Heathfield said:
True enough, but what are the chances that a program will be a
conforming C compiler if not even the author makes the claim that it
is? It doesn't matter whether or not I claim that (a compiled version
of):

#include <stdio.h>
int main(void)
{
return 0;
}

is a conforming C compiler, because conformance tests will show
whether or not it is. But if I as the author don't even make the
claim, why run the tests?

Because they you will know how it performs and what it does.
It is much easier to run the tests and the document the "failures" and
say what it does in those areas.
I believe that's correct.

I must admit I have not looked at the list recently

However I believe it is likely that C1* will loose some of the things in
C99 that "no one" implemented. So it will be far more likely that most
compilers will go from C95 (ISO 989:1990+ A1 + TC1 + TC2 + TC3) to ISO
C1* bypassing C99 and C99 will be "The Standard that never was"
 
J

James Kuyper

Chris H wrote:
....
Testing for compliance will show where they are and are not compliant.

Testing can only show you places where they are not compliant. If test
code works as required by the standard, it could be simply the
consequence of, for instance, having two aspects of non-compliance
cancel each other out.
 
K

Keith Thompson

Chris H said:
However I believe it is likely that C1* will loose some of the things in
C99 that "no one" implemented. So it will be far more likely that most
compilers will go from C95 (ISO 989:1990+ A1 + TC1 + TC2 + TC3) to ISO
C1* bypassing C99 and C99 will be "The Standard that never was"

I've heard this claim before -- but only from you.
 
N

Nobody

I agree. If the Author does not claim compliance then it is not really
fair to test it and shout "not-compliant"

Nor is it fair to test it and shout "compliant" in the event that it
happens to pass.
 
K

Keith Thompson

Richard Heathfield said:
Richard said:
[...]what are the chances that a program will be a
conforming C compiler if not even the author makes the claim that it
is? It doesn't matter whether or not I claim that (a compiled
version of):

#include <stdio.h>
int main(void)
{
return 0;
}

is a conforming C compiler, because conformance tests will show
whether or not it is. But if I as the author don't even make the
claim, why run the tests?

Because they you will know how it performs and what it does.

Okay. Feel free to test the above program (which I do not claim to be
a C compiler) and let me know how it gets on. When you're done, I
have several thousand other non-C-compiler C programs for you to
submit to compiler conformance tests. That should keep you busy...

I don't think you've thought this one through.
[...]

Conformance testing doesn't just give you a boolean result, either
"This is a conforming compiler" or "This is not a conforming
compiler". By keeping track of which tests fail, you can discover
what still needs work (if you're an implementer), or what features
to avoid for now (if you're a user).

If there were a freely available C99 conformance test suite, it
could be very useful to use it on existing compilers that don't
*quite* conform to C99 (gcc, lcc-win, etc.).

Running it on int main(void){return 0;} would be substantially less
useful, unless you want to see how the test suite itself responds
in extreme cases.
 
S

Seebs

If there is a real message about C99 it is that standards groups need to
be
sure that what is codifying what has actually been part of
implementations
instead of insight into where the language is expected to go.

The vast bulk of the stuff that hasn't been widely implemented was stuff
that was in at least one implementation before it got standardized. We
did check on this stuff. People had compilers implementing these features
and some idea of whether they were useful before they got approved.

-s
 
S

Seebs

IIRC Chris is an active ISO C Committee member. If that's correct,
then it's a claim with a certain amount of credibility. No doubt
Larry, Seebs, or possibly Walter(*) can confirm or deny.

I dropped off the committee a while back -- I was between jobs and
couldn't afford it. Since $DAYJOB is now a wholly-owned subsidiary
of Intel, I'm not sure I *could* go back on.

-s
 
S

Seebs

Does $DAYJOB have you working in C or in C#?

C.

I wouldn't get in trouble for suggesting C# for the stuff I do, and after
they'd wiped the tears from their eyes and gotten the giggles under control,
we'd carry on with our meeting normally.

-s
 
F

Flash Gordon

Seebs said:
C.

I wouldn't get in trouble for suggesting C# for the stuff I do, and after
they'd wiped the tears from their eyes and gotten the giggles under control,
we'd carry on with our meeting normally.

In that case you should suggest it. Having a good laugh in a meeting
helps break the ice and encourages making sensible decisions by the end
of the meeting. Well, I think it does anyway.
 
C

Chris H

James Kuyper said:
Chris H wrote:
...

Testing can only show you places where they are not compliant. If test
code works as required by the standard, it could be simply the
consequence of, for instance, having two aspects of non-compliance
cancel each other out.

It doesn't work like that.
 
C

Chris H

Nobody said:
Nor is it fair to test it and shout "compliant" in the event that it
happens to pass.

Agreed. It is up to the compiler maker to claim (or not) compliance.
 
C

Chris H

Richard Heathfield said:
IIRC Chris is an active ISO C Committee member. If that's correct,
then it's a claim with a certain amount of credibility. No doubt
Larry, Seebs, or possibly Walter(*) can confirm or deny.

*I still have no idea whether or not Walter B is on the committee.

I am on the committee. Not particularly active as I have a business to
run. However I do keep track of things as WG14 impacts on other things I
work on. I also have NDA's with about 6 compiler companies.

SO I have a lot of input but as a lot is commercial in confidence and
other stuff is in conversations and not in minuted documents there are
no web links for much of it.

The talk of dropping things from C99 for C1* was at the 2007 London
meeting of WG14. The use of a core language document with separate
appendix for add ons was something I recall working on around 2002/3
with a sub group.
 
C

Chris H

Richard Heathfield said:
Richard said:
[...]what are the chances that a program will be a
conforming C compiler if not even the author makes the claim that it
is? It doesn't matter whether or not I claim that (a compiled
version of):

#include <stdio.h>
int main(void)
{
return 0;
}

is a conforming C compiler, because conformance tests will show
whether or not it is. But if I as the author don't even make the
claim, why run the tests?

Because they you will know how it performs and what it does.

Okay. Feel free to test the above program (which I do not claim to be
a C compiler) and let me know how it gets on. When you're done, I
have several thousand other non-C-compiler C programs for you to
submit to compiler conformance tests. That should keep you busy...

I don't think you've thought this one through.

Not sure what you are saying here.
So in what ways does my "return 0;" program fail to be a conforming C
compiler?

I did not say it was or was not conforming.
 

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,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top