Clang vs GCC for Linux/Unix Programming?

This is a discussion on Clang vs GCC for Linux/Unix Programming? within the C Programming forums, part of the General Programming Boards category; Any advantages or disadvantages to using Clang, as opposed to GCC, for developing in C (mainly) and C++ on Linux? ...

  1. #1
    Registered User
    Join Date
    May 2012
    Posts
    8

    Clang vs GCC for Linux/Unix Programming?

    Any advantages or disadvantages to using Clang, as opposed to GCC, for developing in C (mainly) and C++ on Linux? Programs will be command line only. In my case this would be used for intermediate college level student programs, not production, though you are free to discuss that as well.

  2. #2
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,498
    At this moment, no. (Everything would be pretty similar...(well..other than C++ template errors ))
    GCC will undergo a major overhaul @ version 5 in future. It could change then.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    344
    Agree with above - they're pretty similar in most ways.

    Normally I'd say it would be an interesting idea to get code to work in two different compilers. This lets you make sure you're not accidentally relying on compiler-specific features or getting lucky with undefined behavior working in your favor. But Clang is designed to be a GCC-alike replacement so you're going to lose at least some of that benefit. Still might be a worthwhile idea for the experience, though.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. clang++ works but g++ doesn't -- Maybe a compiler bug?
    By RichSelian in forum C++ Programming
    Replies: 2
    Last Post: 07-11-2011, 08:04 PM
  2. What exactly is unix/linux programming?
    By Rumproast23 in forum Linux Programming
    Replies: 8
    Last Post: 10-07-2006, 03:52 AM
  3. UNIX (Linux, BSD, etc) Programming :: UNIX
    By kuphryn in forum Linux Programming
    Replies: 6
    Last Post: 04-01-2004, 07:44 PM
  4. Suggest a good book for Unix/Linux Network programming
    By Unregistered in forum Linux Programming
    Replies: 4
    Last Post: 06-29-2002, 05:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21