Best free C compiler for Windows, please

S

spinoza1111

I am relearning C in my effort to clean up the nasty tone of this ng.
What is the best C compiler for Windows that is free? Is it Navia's? I
used his last year and it seemed fine. No C99 nonsense please.
 
B

Ben Bacarisse

spinoza1111 said:
I am relearning C in my effort to clean up the nasty tone of this ng.
What is the best C compiler for Windows that is free? Is it Navia's? I
used his last year and it seemed fine. No C99 nonsense please.

Jacob's lcc-win32 is out then. It implements most or all of C99. If
it is not a C99 compiler it is not for want of trying.

Richard Heathfield has posted a list recently, but I can't find the
message. I hear good things about MS's own compiler when given the
right flags to force conformance but I have no recent experience of
it.
 
U

user923005

Jacob's lcc-win32 is out then.  It implements most or all of C99.  If
it is not a C99 compiler it is not for want of trying.

Richard Heathfield has posted a list recently, but I can't find the
message.  I hear good things about MS's own compiler when given the
right flags to force conformance but I have no recent experience of
it.

Considering that someone just posted a message titled:
"Why C is really a bad programming language"
The genuineness of his search for a C compiler is called into
question.

BTW, I think Jacob's compiler is very nice and I am especially fond of
his inclusion of Moshier's extended precision code as an extension to
the langugage.
 
S

spinoza1111

Considering that someone just posted a message titled:
"Why C is really a bad programming language"
The genuineness of his search for a C compiler is called into
question.

Hey, cowboy, I started out in 1401 machine language and worked ten
years in Cobol because I like programming even in crappy languages,
and I'm a professional. The goal is to take down Heathfield, to invade
his turf, burn his huts, and carry off his women. If I have to compile
C I shall.
BTW, I think Jacob's compiler is very nice and I am especially fond of
his inclusion of Moshier's extended precision code as an extension to
the langugage.

By "no C99 nonsense" I didn't mean a compiler with C99 features. I
shall use Navia.
 
L

luserXtrog

I am relearning C in my effort to clean up the nasty tone of this ng.
What is the best C compiler for Windows that is free? Is it Navia's? I
used his last year and it seemed fine. No C99 nonsense please.

Been awhile, but my fav was mingw on cygwin. It came with bash and vi
and all the stuff whose mastery was hard won in cs courses. The point
isn't *nix v. evil empire or anything, but a keyboard is faster than
a mouse. hands down. categorically. In light of that, development
tools which happen, historically, to have been created and honed with
the keyboard at the forefront, [consequently] work more smoothly from
a keyboard than those when depend on mouse selection. Than means unix
tools. Yay cygwin!
 
T

Tom St Denis

spinoza1111 said:


Jacob Navia's compiler is not a conforming C implementation. It
attempts to implement C99 but (as far as this newsgroup is aware has
not yet succeeded). It does not even attempt to conform to C90.
Neither is it free, except for non-commercial use.

Although not explicit in your tone, I'd recommend referring to it as
LCC-Win32 [or whatever capitalization he uses] in the future instead
as by his name. Taking the "personal" aspect out of the conversation
might help to diffuse some of the flamewars here.

That being said, it does implement a reasonable subset of C90/99 even
if it's not strictly conforming. The big losing points for me, aside
from it being in Windows, is that it's not actually free and doesn't
really come with any standard tools you'd expect to see alongside it
like a proper make tool.
The following implementations are free, and conform to C90, modulo
bugs:

Borland C++ 5.5 (despite the name, it does C just fine)

Is unsupported, so a bad idea.
gcc
DJGPP (gcc for MS-DOS)
Microsoft C
mingw (gcc for Windows)
Pacific C
Watcom C

Probably GCC based ones are the best idea because being familiar with
how GCC works opens all sorts of doors down the road. It's used
exclusively in most *NIX platforms, there are versions of GCC for many
embedded platforms, etc. And of course, they're free.

If you're deadset on developing in Windows get a copy of Cygwin and
learn to use the bash shell [and userland tools] it comes with. At
least then you'll be immersed in a real development environment as
opposed to the highly shiny pointy-clickly nonsense that has become
the norm in most Windows environments...

Tom
 
A

arnuld

The following implementations are free, and conform to C90, modulo bugs:

Borland C++ 5.5 (despite the name, it does C just fine) gcc
DJGPP (gcc for MS-DOS)
Microsoft C
mingw (gcc for Windows)
Pacific C
Watcom C


I will add Bloodshed's Dev-C to this list. Its has a nice IDE, colors
etc. Its actually gcc based. Best part, its all free :)
 
S

spinoza1111

spinoza1111said:


Jacob Navia's compiler is not a conforming C implementation. It
attempts to implement C99 but (as far as this newsgroup is aware has
not yet succeeded). It does not even attempt to conform to C90.
Neither is it free, except for non-commercial use.

The following implementations are free, and conform to C90, modulo
bugs:

Borland C++ 5.5 (despite the name, it does C just fine)
gcc
DJGPP (gcc for MS-DOS)
Microsoft C
mingw (gcc for Windows)
Pacific C
Watcom C

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
This line unintentionally left unblank

Thanks for the list, but on what basis do you claim that Navia does
not conform? Is this just your usual scoffing bile, or can you post a
proof?
 
G

Gustavo Rondina

I will add Bloodshed's Dev-C to this list. Its has a nice IDE, colors
etc. Its actually gcc based. Best part, its all free :)

IIRC, Bloodshed's Dev-C uses mingw. It's quite a nice IDE indeed.
 
T

Tom St Denis

I understand your point, but in fact the lack of support doesn't
matter a huge deal if you're only interested in getting up to speed
with C. The compiler works just fine (modulo a possible problem with
errno, IIRC), and the lack of support only really becomes an issue if
you actually need the support. (At which point, by all means switch
to a supported implementation. Since your code is 100% ISO C, this
won't have any impact on you other than recompilation.)

Sure I may have been a bit harsh. I did after all get started on
copies of Turbo C++ 1.0 Lite, and Borland C++ as well.

I suppose though if I had a copy of GCC handy for MS-DOS 5.0 in the
early 90s I'd probably go for that if I could. So I suppose my point
is given that GCc ports do exist, work well [but not perfectly] and
are freely available they're probably a better option. The fact
they're also supported is nice.

But I didn't mean to imply that Borland C++ is useless or garbage.
If you just use Visual C++ as a C IDE/compiler, it is actually quite a
productive environment. For Win32 API development, it's hard to beat
- although, if I'm in a hurry, I'm quite content to cheat and use C++
Builder).

Well there are features I like from their editor/debugger (like tab
completion, being able to find declarations quickly, etc) but the
whole build system/compiler is sketchy in my eyes. They should really
make better use of human readable makefiles, their compiler should be
more standards conforming, and if I dare ask, support a few GCC
extensions like ICC does (like inline-asm).

If they ported their Visual Studio 6.0 IDE to Linux I'd probably use
it, even if I had to shell out a few teners to buy it. But they won't
so I get along with things like vim, gedit, and all manners of
userland tools to speed up development.

Tom
 
S

spinoza1111

spinoza1111said:



He has said publicly that he has no intention of modifying lcc-win32
to conform to C90, from which it is easy to deduce that it doesn't
currently conform (or at least that he thinks it doesn't), even
without any further information. There have, however, also been
certain indications on this newsgroup that lcc-win32 has some
conformance issues which have been reported to him and which he has
decided not to address. (The example that springs to mind is
BCPL-style comments, which require a diagnostic message in C90.)

He has also *not* said publicly (as far as I can tell), not even on
his Web site, that his implementation conforms to C99.

Please note that he is under no obligation to conform to any standard
whatsoever. Nobody is *obliged* to write a C compiler.


As far as I am aware, the above explanation says nothing with which
Jacob Navia would disagree. If I am wrong about that, no doubt he
will say so.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
This line unintentionally left unblank

OK, clears it up.
 
J

jellybean stonerfish

I am relearning C in my effort to clean up the nasty tone of this ng.

I am relearning C too. Let's go through the examples one at a time.
Then move on to the exercises.

The "first C program" looks simple enough, but there are some things left
out.

#include <stdio.h>

main()
{
printf("hello, world\n");

}


I think the function definition "main()" should be "int main(void)", and
a return value shoud be given. Also comments should be included.

#include <stdio.h>

/*
* Print the text "Hello, World."
*/

int main(void)
{
printf("Hello, World.\n");
return 0;
}


What is the best C compiler for Windows that is free?

gcc is free, don't know how well the windows version works. ? MinGW ?
Is it Navia's? I used his last year and it seemed fine.

I don't believe lcc-win32 is free. You can use it for free non-
commercial use, but need to pay for professional use. You aren't
planning on using it for professional use as C is unsafe, so the
commercial licence is not needed. Still, I would suggest a "free"
software alternative.
No C99 nonsense please.
-std=c99 bottles of beer on the -Wall
-std=c99 bottles of beer

stonerfish
 
J

jellybean stonerfish

Hey, cowboy, I started out in 1401 machine language and worked ten years
in Cobol because I like programming even in crappy languages, and I'm a
professional. The goal is to take down Heathfield, to invade his turf,
burn his huts, and carry off his women. If I have to compile C I shall.

I thought the goal was to "clean up the nasty tone of this ng"
I actually tried to give this thread a chance.
 
S

Stephen Sprunk

jellybean said:
The "first C program" looks simple enough, but there are some things left
out.

#include <stdio.h>

main()
{
printf("hello, world\n");

}


I think the function definition "main()" should be "int main(void)", and
a return value shoud be given. Also comments should be included.

#include <stdio.h>

/*
* Print the text "Hello, World."
*/

int main(void)
{
printf("Hello, World.\n");
return 0;
}

Style nit: Comments which tell you things that are obvious from reading
the code are a Bad Idea(tm) for several reasons:

1. They reduce the amount of actual code that can fit on the screen (or
page), requiring more effort to read and understand.

2. They can get out of sync with the code, leading programmers to
misunderstand what the code actually does.

3. They distract from comments that _are_ necessary to explain complex,
non-obvious code.

I understand that some may think that exceptions should be made for
beginners, but you are indirectly teaching style at the same time and it
is better to teach good style than bad, lest that beginner think he
should always litter his code with superfluous comments.

S
 
F

Flash Gordon

Tom St Denis wrote:

Well there are features I like from their editor/debugger (like tab
completion, being able to find declarations quickly, etc) but the
whole build system/compiler is sketchy in my eyes.

Then don't use the build system.
They should really
make better use of human readable makefiles,

Then use one. Email me if you want me to look up the details, or ask on
a appropriate group.
their compiler should be
more standards conforming,

It is, to C90. C99 would be nice.
and if I dare ask, support a few GCC
extensions like ICC does (like inline-asm).

Well, icc was, as I understand it, deliberately designed to be close to
a simple replacement for gcc. However, the problem with extensions, of
course, is that in general they are not portable!
If they ported their Visual Studio 6.0 IDE to Linux I'd probably use
it, even if I had to shell out a few teners to buy it. But they won't
so I get along with things like vim, gedit, and all manners of
userland tools to speed up development.

There are ways which might work, and thinking about it I might
investigate them for my use...
 
R

Richard Bos

jellybean stonerfish said:
The "first C program" looks simple enough, but there are some things left
out.

#include <stdio.h>

main()
{
printf("hello, world\n");

}

I think the function definition "main()" should be "int main(void)",

That's better, but in C90 not required.
and a return value shoud be given.

And that's better, and required in C90, but unfortunately not in C99.
Also comments should be included.

Well... maybe, but...
#include <stdio.h>

/*
* Print the text "Hello, World."
*/

....any comment which states the obvious should be excised. This one, for
example, adds nothing to the legibility of the program. In fact, because
it takes up space without using it for something useful, it reduces
legibility.
int main(void)
{
printf("Hello, World.\n");
return 0;
}

Richard
 
W

Walter Banks

Richard said:
spinoza1111 said:


Jacob Navia's compiler is not a conforming C implementation. It
attempts to implement C99 but (as far as this newsgroup is aware has
not yet succeeded). It does not even attempt to conform to C90.
Neither is it free, except for non-commercial use.

The following implementations are free, and conform to C90, modulo
bugs:

Borland C++ 5.5 (despite the name, it does C just fine)
gcc
DJGPP (gcc for MS-DOS)
Microsoft C
mingw (gcc for Windows)
Pacific C
Watcom C

I think that you will find that GCC is about as conforming as LCC-Win32. The issues I have seen have been both super and subset of both C90 and C99.

The biggest issue seems to be the lacking of publically available information on language conformance testing.

Regards,
 
J

jellybean stonerfish

Well... maybe, but...


...any comment which states the obvious should be excised. This one, for
example, adds nothing to the legibility of the program. In fact, because
it takes up space without using it for something useful, it reduces
legibility.

OK, I will agree with that.
 
F

Flash Gordon

Walter said:
I think that you will find that GCC is about as conforming as LCC-Win32. The issues I have seen have been both super and subset of both C90 and C99.

The last I saw gcc was believed to fully conform to C90 (when used in
conjunction with a suitable C library) and any non-conformance which
given the correct options would be accepted as a bug.

The last definitive statement I saw in terms of lcc-win32 said there
were things in C99 not yet implemented and (as a valid design decision)
it did not attempt to conform to C90.

I consider these to be significant differences in terms of conformance.
The biggest issue seems to be the lacking of publically available information on language conformance testing.

At least the gcc team make a clear statement as to the believed level of
conformance (complete for C90, not yet for C99). That, in my book, is
probably the biggest advantage of gcc over lcc-win32 when it comes to
conformance (one can sometimes live with non-conformance when one knows
where it is).
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top