Which compiler for a learner of C?

R

Richard Heathfield

jaysome said:

Have you ever actually installed and used a version of lcc-win32?

Nope. I use Linux. Why would I need lcc-win32?

But until recently, despite never having installed it, I had a link to it on
my Web site, suggesting it as a free compiler that people might like to use
if they happen to be on a Windows platform. I removed the link recently
because, after reading what Mr Navia has had to say in comp.lang.c in the
last few weeks, I lack confidence that the compiler is a conforming C
compiler.

That does not mean I am claiming it is not conforming. It means I lack
confidence that it is conforming. Just recently we discovered here in clc
that it was not conforming in one particular respect, and Mr Navia fixed it
very promptly when it was pointed out, for which he is to be commended. But
I'm wondering how many other non-conformances are lurking therein, given Mr
Navia's rather cavalier statements about pedantry.
 
R

Richard Heathfield

Michael Mair said:
Hmmm, that may be true for small to middle projects.
However, the fact that some of the standard headers lead to warnings,

Yes, the most stupid being the // in math.h

But in fact that was the only one I couldn't get rid of, at Warning Level 4.
(Many a time I've been tempted to go and hack math.h into bits.)
that you cannot rely on the optimisation to produce the same programme
behaviour as unoptimised code, and that it cannot compile and link
projects of a certain size in Debug mode make it a beginners' tool in
my eyes.

Check the topic title again. :)

And in any case I've compiled and linked programs hundreds of KLOC in size
on VStudio without problems. I accept that hundreds of KLOC counts as a
middle-sized project at most, but I doubt whether a much bigger project is
worth developing on Windows, since surely such a large development
investment merits spending a little extra to acquire a stable platform. :)
 
B

BRG

pkirk25 wrote:

[snip]
Is Visual C++ Express a good compiler?

This depends on your criteria for 'good' but for simple C/C++
development tasks on the Windows platform I would say 'yes' provided you
don't mind the overhead of what is a large package.

The Express compiler has a few limitations (e.g. no 64-bit support) but
the IDE is very good and the compiler comes with an optimiser that is
capable of producing very good code.

However the IDE/compiler is a large package and takes considerable time
to download and install. It also takes up quite a lot of disc space and
you also need the platform SDK if you want to develop code to run on
Windows (the SDK is another large download). Also the documentation,
although extensive, is not ideal for someone who is learning C/C++ since
it is oriented towards professional developers and Windows applications.

So you need to invest time and effort to get up and running with VC++
Express but I think the result will probably justify this investment if
you run Windows.

Brian Gladman
 
J

jacob navia

Richard said:
jaysome said:




Nope. I use Linux. Why would I need lcc-win32?

But until recently, despite never having installed it, I had a link to it on
my Web site, suggesting it as a free compiler that people might like to use
if they happen to be on a Windows platform. I removed the link recently
because, after reading what Mr Navia has had to say in comp.lang.c in the
last few weeks, I lack confidence that the compiler is a conforming C
compiler.


I still have your book in the bibliography section in my tutorial.
I am able to distinguish between my personal like/dislike for
a person, and his work, that should be judged independently of the
author.


jacob
 
P

pkirk25

[snip]
The Express compiler has a few limitations (e.g. no 64-bit support) but
the IDE is very good and the compiler comes with an optimiser that is
capable of producing very good code.


Brian Gladman

Brian, the IDE is lovely - and based on your advice I skipped the MSDN
download so saved 3.8 gigs of disk space and probably will be in much
the same position I am now - Google is the ultimate manual.

Many thanks.
 
R

Richard Heathfield

jacob navia said:
I still have your book in the bibliography section in my tutorial.
I am able to distinguish between my personal like/dislike for
a person, and his work, that should be judged independently of the
author.

What has liking or disliking to do with it? I can't abide Microsoft, but I
still provide a link to their compiler.
 
R

Richard Heathfield

pkirk25 said:
I skipped the MSDN
download so saved 3.8 gigs of disk space and probably will be in much
the same position I am now - Google is the ultimate manual.

And anyway MSDN can be found at http://msdn.microsoft.com so you simply
browse the bits you need when you need them. Handy for Win32 stuff. For C
stuff, though, I suggest a decent C reference book rather than MSDN!
 
P

pkirk25

BRG said:
pkirk25 wrote:
Actually, while it looks nice enough, it doesn't compile my existing C
code.

..\parameters.cpp(13) : error C2440: 'initializing' : cannot convert
from 'void *' to 'char *'
Conversion from 'void*' to pointer to non-'void' requires an
explicit cast

Also it swaps you in warnings like
..\parameters.cpp(38) : warning C4996: 'strcpy' was declared deprecated
 
B

Ben Pfaff

[about some implementation]
Actually, while it looks nice enough, it doesn't compile my existing C
code.

.\parameters.cpp(13) : error C2440: 'initializing' : cannot convert
from 'void *' to 'char *'
Conversion from 'void*' to pointer to non-'void' requires an
explicit cast

A file whose name ends in .cpp is generally C++, not C. That's a
C++-specific error. Try renaming it to parameters.c.
 
R

rzed

Actually, while it looks nice enough, it doesn't compile my
existing C code.

.\parameters.cpp(13) : error C2440: 'initializing' : cannot
convert from 'void *' to 'char *'
Conversion from 'void*' to pointer to non-'void'
requires an
explicit cast

Also it swaps you in warnings like
.\parameters.cpp(38) : warning C4996: 'strcpy' was declared
deprecated

C is not C++, remember. If your file names are *.cpp, I'm dubious
that your compiler is trying to compile them as C.
 
M

Malcolm

pkirk25 said:
I own a legit copy of Visual C++ 6.0

Its nice but it is 10 years old and aimed at C++.
A ten year old compiler will be worn out by now.
Personally I never go more than three years with a car, for example.
Get a brand new one.
 
B

BRG

pkirk25 said:
Actually, while it looks nice enough, it doesn't compile my existing C
code.

.\parameters.cpp(13) : error C2440: 'initializing' : cannot convert
from 'void *' to 'char *'
Conversion from 'void*' to pointer to non-'void' requires an
explicit cast

Also it swaps you in warnings like
.\parameters.cpp(38) : warning C4996: 'strcpy' was declared deprecated

The IDE will normally compile files with the 'cpp' extension as C++
rather than C.

Somewhat annoyingly it will even compile files with the 'c' extension as
C++ as well unless you turn off this 'feature' in the property page for
the project and/or file concerned (this option is under C/C++|Advanced
in the property dialogue).

Why it has been set to behave like this as default is beyond me (I don't
think this is caused by my own configuration but it might be).

Brian
 
J

jmcgill

Malcolm said:
A ten year old compiler will be worn out by now.
Personally I never go more than three years with a car, for example.

When the wheels fall off my 1991 Volvo... or more realistically, the
first time I have paid in maintenance costs some amount approaching the
amount that financing a new car with the same performance
characteristics would cost during an equivalent period, I will start to
think about the possibility of buying a new car.
 
M

Mark McIntyre

Look lcc-win32 is a compiler system written for developing in C.

Jacob should have mentioned that he is the owner of lcc-win32.

Personally I consider it a little naughty not to mention a personal
interest when one exists, however thats my preference.
--
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 am able to distinguish between my personal like/dislike for
a person, and his work, that should be judged independently of the

I believe Richard has made it more than totally clear in his above
comment that this is /precisely/ what he is doing.
--
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

The flaw that I pointed out doesn't disturb you of course:
The libraries are not in phase with the compiler (gcc).
The program compiles with no warnings under Bloodshed,
but it gives wrong results.

I'm struggling to understand why you think a flaw in Bloodshed is even
remotely relevant to Richard's comment about Visual C++ 6.0
What flaws are concerned, you seem to be very selective...

Or possibly, he reads carefully before typing.
--
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

Hmmm, that may be true for small to middle projects.
However, the fact that some of the standard headers lead to warnings,
that you cannot rely on the optimisation to produce the same programme
behaviour as unoptimised code, and that it cannot compile and link
projects of a certain size in Debug mode make it a beginners' tool in
my eyes.

Euh, you might want to point that out to the many major international
companies who used it extensively in its time.

For what its worth I dispute all three of your findings too (two of
them entirely, and one somewhat), but heck, this isn't a Microsoft
advocacy group, nor yet one discussing MSVC so...

--
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

Actually, while it looks nice enough, it doesn't compile my existing C
code.

.\parameters.cpp(13) : error C2440: 'initializing' : cannot convert
from 'void *' to 'char *'
Conversion from 'void*' to pointer to non-'void' requires an
explicit cast

Also it swaps you in warnings like
.\parameters.cpp(38) : warning C4996: 'strcpy' was declared deprecated


These are C++ errors, generated because you're letting the GUI name
your files for you and by default it calls them .cpp.
Go to Folder Options in Explorer, and tell it NOT to hide extensions
on files, this is anyway just a security flaw as it lets virus writers
drop files on your computer and hide the fact they're executables.
--
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
 
D

Default User

Malcolm said:
A ten year old compiler will be worn out by now.
Personally I never go more than three years with a car, for example.
Get a brand new one.


I'm still driving my 1995 full-sized Bronco, and plan to for many years
to come, thank you very much. New cars are a ludicrous waste of money,
I never buy one unless it's at least four years old. Get ones with low
mileage (international - kilometerage) and let the fool new-car buyer
take the big depreciation hit.




Brian
 
R

Rod Pemberton

Richard Heathfield said:
That does not mean I am claiming it is not conforming. It means I lack
confidence that it is conforming.

Use a Microsoft compiler. They are notorious for non-conformance. Just
read the comments by Michal Necasek (lead maintainer for OpenWatcom) on
openwatcom.contributors or openwatcom.users.c_cpp. Or, look at GCC C99
compliance page or GCC extensions page. The point that you lack confidence
is rather meaningless when most of the strong competitors to lcc-win32 fail
on conformance...


Rod Pemberton
 

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

Latest Threads

Top