Thread: Clang vs GCC for Linux/Unix Programming?

  1. #1
    Registered User
    Join Date
    May 2012

    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
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    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.

  3. #3
    Registered User
    Join Date
    Mar 2009
    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, 08: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