Clang vs. GCC: Compare & Contrast?

Discussion in 'C Programming' started by haziz, Mar 23, 2012.

  1. haziz

    haziz Guest

    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.
     
    haziz, Mar 23, 2012
    #1
    1. Advertising

  2. haziz <> writes:

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

    --
    Ben.
     
    Ben Bacarisse, Mar 23, 2012
    #2
    1. Advertising

  3. haziz

    Kaz Kylheku Guest

    On 2012-03-23, haziz <> wrote:
    > 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.
     
    Kaz Kylheku, Mar 23, 2012
    #3
  4. haziz

    Jens Gustedt Guest

    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
     
    Jens Gustedt, Mar 23, 2012
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QUNhdW50ZXI=?=

    Control Image Contrast, Brightness, and Sharpness

    =?Utf-8?B?QUNhdW50ZXI=?=, Feb 22, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,728
    Kevin Spencer
    Feb 22, 2005
  2. Replies:
    0
    Views:
    1,522
  3. Desk-of-David
    Replies:
    6
    Views:
    7,238
    Desk-of-David
    Apr 6, 2007
  4. Johannes Schaub (litb)

    Weird difference between comeau and gcc/clang

    Johannes Schaub (litb), Oct 13, 2010, in forum: C++
    Replies:
    15
    Views:
    613
    James Kanze
    Oct 18, 2010
  5. Lynn McGuire
    Replies:
    0
    Views:
    208
    Lynn McGuire
    Mar 15, 2013
Loading...

Share This Page