Good shareware compiler for C?

G

Guest

Dave said:
You are right. But, the only ANSI C (1989) library functions that AMPC
does
not support are longjmp(), setjmp(),

setjmp is a macro, not a function. It seems to me that it shouldn't be
too hard to invoke some compiler magic to compile setjmp/longjmp as a
fairly thin wrapper around try/throw.
signal(), and raise().

Why not those? They should be some of the easiest to implement,
especially since there's no requirement that an implementation be able
to actually generate signals asynchronously.

Here's a first pass at it to get you started.
(Not compiled or tested. The usual disclaimers apply, and then some.) [...]
--------signal_implementation.c
#include <signal.h>
#include <stdlib.h>

void __sig_dfl(int sig)
{
if(sig==SIGTERM || sig==SIGINT)
{
/*termination request or interrupt are typically
not fatal errors
*/
exit(EXIT_SUCCESS);

<Semi-OT>
If a process exits from SIGTERM or SIGINT, normally it is not
considered to have exited successfully. If you have access to a
Unix-style system (Linux is good enough), try something like 'cat &&
echo success', and then send cat a SIGINT signal, for a simple example.
Or run a tool exiting from SIGTERM as part of any build system; most
will halt afterwards.
</Semi-OT>

[...]
Question for the language lawyers: Is this a correct C program?
--------
#include <signal.h>
int main(void)
{
SIG_DFL(SIGTERM);
return 0;
}

I suspect it isn't, either. I don't see anything preventing SIG_DFL
from being a null pointer, or a converted pointer to an incompatible
function, or a valid pointer to a non-function.
 
B

Ben Bacarisse

Jorgen Grahn said:
CBFalconer said:
Serve Laurijssen wrote:
gcc -W -Wall -pedantic -std=c99

The latter doesn't entirely conform to the C99 standard;
it might or might not be close enough for your purposes.
See <http://gcc.gnu.org/c99status.html>.
[long snip]
Possibly the web page doesn't reflect the latest release, and/or
perhaps some of the macro values don't quite reflect reality.

They have, oddly enough, one general list and one per major release. I
surely hope those ones are correct, e.g.
http://gcc.gnu.org/gcc-4.1/c99status.html

Well something is not quite synchronised since that document says:

EC 60559 is IEEE 754 floating point. This works if and only if the
hardware is perfectly compliant, but GCC does not define
__STDC_IEC_559__ or implement the associated standard pragmas.

but KT's gcc 4.1.1 output that you snipped had:

__STDC_IEC_559__ = 1

and that is also the result with 4.0.3.
 
S

Serve Laurijssen

Stephen Sprunk said:
Not at all. However, if GCC proponents came here and told people to use
their non-standard extensions without identifying them as such, they'd be
smacked down just like Mr. Navia is (on a regular basis).

The GCC people stick to their own newsgroups. On the rare occasions GCC
extensions are proposed by regulars here, they're clearly noted as such.
Mr. Navia has shown absolutely no inclination to follow accepted
netiquette or topicality, despite having been asked several dozen times.
_That_ is why he is disliked, not his extensions. He's welcome to discuss
them all he likes over in the newsgroup for LCC.

yes yes, still no reason to say "dont get his products because he is evil
man"
I'd expect people to appreciate when somebody helps the C community a lot by
providing a free windows C compiler with IDE, whether you like him or not.
But whatever, he sometimes kicks against some newsgroups standing rules so
he should buuuuuurn in hell
 
D

Dave Vandervies

yes yes, still no reason to say "dont get his products because he is evil
man"

Would you get in a car driven by somebody who thought driving on the
right[1] side of the road was optional?
If not, why would you use a compiler written by somebody who thought
that following the definition of the language is optional?

We're not disrecommending his compiler because we think he's evil; we're
disrecommending it because his conduct here raises serious questions about
its utility for those who want to write C and not C-with-navia-extensions.

I'd expect people to appreciate when somebody helps the C community a lot by
providing a free windows C compiler with IDE, whether you like him or not.
But whatever, he sometimes kicks against some newsgroups standing rules so
he should buuuuuurn in hell

The disservice done by his insistence on treating his extensions as
if they were part of the language and misrepresenting and/or insulting
those who object to the way in which he does so (or disagree with him
on pretty much anything else) outweighs the service done by providing
a compiler.
Either he thinks that he, unlike anybody else who has ever extended
the language, is allowed to insist on acting as if navia-C were
interchangeable with C over the objections of those who point out that it
isn't, or he's just too stupid to recognize the difference; either way,
his contribution falls rather short of being welcome.


dave

[1] That's "right" as in "correct", not as in "opposite of left".
This becomes important when you try to internationalize this sentence.
 
J

jacob navia

Dave Vandervies a écrit :
Serve Laurijssen said:
yes yes, still no reason to say "dont get his products because he is evil
man"


Would you get in a car driven by somebody who thought driving on the
right[1] side of the road was optional?
If not, why would you use a compiler written by somebody who thought
that following the definition of the language is optional?

This is a lie. I have explained hundreds of times that my extensions
are 100% compatible with the standard, that does NOT forbid extensions.
This is a lie. I can't explain it yet another time since no matter what
I say this lies will go on.
We're not disrecommending his compiler because we think he's evil; we're
disrecommending it because his conduct here raises serious questions about
its utility for those who want to write C and not C-with-navia-extensions.

This is a lie. There is the -ansic flag that conforms to ansic without
any extensions. Another lie.
The disservice done by his insistence on treating his extensions as
if they were part of the language

This extensions are clearly signalled in the documentation and here in
the discussions as extensions. I have never said that the language is
like this,
and the reason for my proposing them here is precisely because they
are not part of the language. But I can say this 1000 times and this
people will go on lying.

and misrepresenting and/or insulting
those who object to the way in which he does so (or disagree with him
on pretty much anything else) outweighs the service done by providing
a compiler.

I try to avoid insults. Not like some others like
mcintyre that treats me of "idiot" in each discussion.

Either he thinks that he, unlike anybody else who has ever extended
the language, is allowed to insist on acting as if navia-C were
interchangeable with C over the objections of those who point out that it
isn't, or he's just too stupid to recognize the difference; either way,
his contribution falls rather short of being welcome.

Then, please you put me in your killfile and then finished ok?
 
I

Ian Collins

Dave said:
Would you get in a car driven by somebody who thought driving on the
right[1] side of the road was optional?
If not, why would you use a compiler written by somebody who thought
that following the definition of the language is optional?
So you'd say the same about the authors of gcc? Both compilers have
their standard mode (includes extensions) and ANSI modes.

More porting problems have been caused by gratuitous use of gcc
extensions than just about anything else. Despite this, I don't see
people saying don't use gcc.

Please keep posts civil, personal insults don't belong here.
Either he thinks that he, unlike anybody else who has ever extended
the language, is allowed to insist on acting as if navia-C were
interchangeable with C over the objections of those who point out that it
isn't, or he's just too stupid to recognize the difference; either way,
his contribution falls rather short of being welcome.
Does he? Can you cite an example?
 
B

Ben Pfaff

Ian Collins said:
Dave said:
Would you get in a car driven by somebody who thought driving on the
right[1] side of the road was optional?
If not, why would you use a compiler written by somebody who thought
that following the definition of the language is optional?
So you'd say the same about the authors of gcc? Both compilers have
their standard mode (includes extensions) and ANSI modes.

I don't see the authors of GCC posting here without properly
distinguishing between standard features and extensions. I have
seen Jacob do that numerous times.
 
I

Ian Collins

Ben said:
Dave said:
Would you get in a car driven by somebody who thought driving on the
right[1] side of the road was optional?
If not, why would you use a compiler written by somebody who thought
that following the definition of the language is optional?

So you'd say the same about the authors of gcc? Both compilers have
their standard mode (includes extensions) and ANSI modes.


I don't see the authors of GCC posting here without properly
distinguishing between standard features and extensions. I have
seen Jacob do that numerous times.

Maybe I'm getting forgetful in my old age, but I thought Jacob qualifies
his extensions with something like "the lcc implementation of..." when
first mentioning them on a thread.
 
M

Mark McIntyre

Please keep posts civil, personal insults don't belong here.

I agree. You might want to mention that to JN, next time he starts
ranting at Keith or Richard.
(Dave V said)
Does he? Can you cite an example?

Pick virtually any thread of JN's and it will quite shortly
demonstrate this. The general model is to propose something offtopic,
be advised of this, and then drop into rant mode claiming it _is_
topical because he wants it to be, that C will die unless he's allowed
his say, that people arguing for topicality are bigots, and so forth.
At some point he'll enter into a flame war with several of the
regulars here, involving him suggesting they're too stupid and
hidebound to understand the complicated modern ideas he has, and them
being highly sarcastic in return.

If you've not spotted it I can noly assume you aren't following the
threads beyond the first post. :)
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
M

Mark McIntyre

I try to avoid insults.

Really? I hadn't noticed.
Not like some others like
mcintyre that treats me of "idiot" in each discussion.

Remember what Forrest Gump said.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
I

Ian Collins

Mark said:
I agree. You might want to mention that to JN, next time he starts
ranting at Keith or Richard.
I will!


Pick virtually any thread of JN's and it will quite shortly
demonstrate this. The general model is to propose something offtopic,
be advised of this, and then drop into rant mode claiming it _is_
topical because he wants it to be, that C will die unless he's allowed
his say, that people arguing for topicality are bigots, and so forth.
At some point he'll enter into a flame war with several of the
regulars here, involving him suggesting they're too stupid and
hidebound to understand the complicated modern ideas he has, and them
being highly sarcastic in return.

If you've not spotted it I can noly assume you aren't following the
threads beyond the first post. :)

But it's the first post that matters, that's where the extension is
qualified, what follows often degenerates into a slanging match.
 
J

jacob navia

Ben Pfaff a écrit :
Dave said:
Would you get in a car driven by somebody who thought driving on the
right[1] side of the road was optional?
If not, why would you use a compiler written by somebody who thought
that following the definition of the language is optional?

So you'd say the same about the authors of gcc? Both compilers have
their standard mode (includes extensions) and ANSI modes.


I don't see the authors of GCC posting here without properly
distinguishing between standard features and extensions. I have
seen Jacob do that numerous times.

This is a lie. I have never shown my extensions as being
part oif the language.

The people of gcc do not discuss anything about C.

C is dead for them and it is maintained for compatibility
reasons, but all their effort is for C++.

The problem with me is that I develop the only C compiler
that is NOT a C++ compiler.
 
J

jacob navia

Ian Collins a écrit :
Ben said:
Dave Vandervies wrote:


Would you get in a car driven by somebody who thought driving on the
right[1] side of the road was optional?
If not, why would you use a compiler written by somebody who thought
that following the definition of the language is optional?


So you'd say the same about the authors of gcc? Both compilers have
their standard mode (includes extensions) and ANSI modes.


I don't see the authors of GCC posting here without properly
distinguishing between standard features and extensions. I have
seen Jacob do that numerous times.


Maybe I'm getting forgetful in my old age, but I thought Jacob qualifies
his extensions with something like "the lcc implementation of..." when
first mentioning them on a thread.

I have always done that. In the documentation I have tried
to document each extension as such.
 
J

jacob navia

Ian Collins a écrit :
Take care, some of you extensions are heading that way :)

The whole thing is to see when you STOP.

In general the dividing line between C and C++ is
the object oriented approach. C is NOT "object oriented", and
as a NON object oriented language it has a bright future.

The object oriented hype has been forced into the
software construction process, even if it is not the
best approach in many cases. By making C a safer language
and improving the expressivity of the language an
alternative to the OO aproach emerges.

Another important point is that we have the experience of
C++, and for instance in the operator overloading approach
we can avoid pitfalls like allowing to overload the
"&&" or "||" operators... something every C++ book tries to
explain to novices: Do not do that.

Well, it is easier if the language does NOT allow the overloading
of "&&" or "||".
 
I

Ian Collins

jacob said:
Ian Collins a écrit :



The whole thing is to see when you STOP.
Some would argue that the C99 committee didn't and that's why the
standard hasn't gained a wider acceptance. Any extension to the
language has to be accepted by the (conservative) C community well
before it is considered for standardisation. Which in practice means
being added to gcc. Thus any extension that is part of C++ will never
be added to gcc's C compiler, because people can just use its C++ mode
and get what they want.

So you are probably flogging a dead horse when it comes to operator
overloading in C.
 
G

Guest

jacob said:
This is a lie. I have never shown my extensions as being
part oif the language.

The people of gcc do not discuss anything about C.

C is dead for them and it is maintained for compatibility
reasons, but all their effort is for C++.

Then why is C99 (slowly) being implemented in gcc at all?
The problem with me is that I develop the only C compiler
that is NOT a C++ compiler.

Even if you refuse to count other lcc-based projects, I can think of
some others:
<http://www.ten15.org/> (this one does contain a C++ mode, but it is
so severely lacking that I cannot call it a C++ compiler, and no
efforts to improve its C++ mode are made at this time)
<http://nwcc.sourceforge.net/>
<http://www.cs.vu.nl/ack/>
 
S

santosh

jacob said:
Ben Pfaff a écrit :
Dave Vandervies wrote:

Would you get in a car driven by somebody who thought driving on the
right[1] side of the road was optional?
If not, why would you use a compiler written by somebody who thought
that following the definition of the language is optional?


So you'd say the same about the authors of gcc? Both compilers have
their standard mode (includes extensions) and ANSI modes.


I don't see the authors of GCC posting here without properly
distinguishing between standard features and extensions. I have
seen Jacob do that numerous times.

This is a lie. I have never shown my extensions as being
part oif the language.

The people of gcc do not discuss anything about C.

C is dead for them and it is maintained for compatibility
reasons, but all their effort is for C++.

The problem with me is that I develop the only C compiler
that is NOT a C++ compiler.

Don't be too quick in jumping to conclusions. There's also PellesC,
based on the same frontend as lcc-win32.

<http://www.smorgasbordet.com/pellesc/>
 

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
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top