6

Why use Clang over GCC?

Comments
  • 3
    For Android? Because the NDK has deprecated GCC long ago and will remove it completely with NDK r18.
  • 0
    @Fast-Nop I speak from a multiplatform point of view.
  • 4
    It gives pretty errors
  • 0
  • 2
    I prefer gcc but clang has really nice colourful output
  • 4
    Clang came about mostly because of licensing. GPL vs BSD/MIT/Apache is a big thing in the open source community. A lot of the former dreams about OSS died out in the early 2000s sadly.

    I wrote a post about this a while ago:

    https://penguindreams.org/blog/...
  • 1
  • 1
    @juandroid007 GCC is more monolith than Clang, which is why you can hook an IDE with IDE magic better into Clang than into GCC.

    Also, Clang is said to be capable of delivering output for multiple platforms just like that while GCC has to be built for each platform.
  • 1
    @juandroid007 clang. It has very nice output.
  • 0
  • 1
    Personally, I prefer GCC because it comes ready-built for a lot of platforms besides Linux. MingW makes it easy on Windows, and I'm especially invested in the arm-none-eabi version, i.e. the bare metal version targeted at Cortex-M, which is hosted at the ARM website. I've yet to see a Clang equivalent.
  • 1
    @djsumdog That's a damn good read son, you just got yourself your blogpost fucking bookmarked.

    I will remember these words when i release my own software.
  • 1
    In the last few updates, GCC has improved A LOT its error messages, but I still prefer Clang's.
    If you do any cross compilation, Clang is able to compile for any platform LLVM supports (which is most of the ones you may find), with a single executable, whereas GCC has to be recompiled for each source-target pair.
    Clang's license if more free.
    However, you need to install clang on most linux distros, whereas gcc is already pre-packaged. (If I remember correctly, Macs use clang as the default)
Add Comment