Clang vs. GCC: Compare & Contrast?

H

haziz

Any advantages or disadvantages to using clang, as opposed to GCC, for developing in C on Linux? In my case this would be used for student level programs, not production, though you are free to discuss that as well.
 
B

Ben Bacarisse

haziz said:
Any advantages or disadvantages to using clang, as opposed to GCC, for
developing in C on Linux? In my case this would be used for student
level programs, not production, though you are free to discuss that as
well.

On the few occasions when I've used it, I liked the error messages.
They are some times clearer than GCC's and that must be significant for
students. Can't both be installed so you can get *them* to tell you
which is better for student work?
 
K

Kaz Kylheku

Any advantages or disadvantages to using clang, as opposed to GCC, for
developing in C on Linux? In my case this would be used for student level
programs, not production, though you are free to discuss that as well.

The most educational thing is to compile your homework programs with as many
compilers as you can get your hands on without spending an unreasonable time.

Run your student programs through clang as well as gcc and study their
diagnostics. It's like going to two doctors to get a second opinion.
 
J

Jens Gustedt

Am 03/23/2012 06:53 PM, schrieb haziz:
Any advantages or disadvantages to using clang, as opposed to GCC,
for developing in C on Linux? In my case this would be used for
student level programs, not production, though you are free to
discuss that as well.

clang's error messages are definitively better suited for students
(and anybody else actually)

If you want to teach them modern C, their progress on implementing C11
seems to go in different directions. gcc is getting close to have an
implementation of the atomics, probably a good subject for teaching if
you would be talking about threads, signal handlers and stuff like
that.

clang already has _Generic, so if you want to cover type generic
programming, tgmath.h and alike, clang offers more.

Jens
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top