Clang vs GCC for my Linux Development project

后端 未结 6 1473
再見小時候
再見小時候 2020-12-22 16:01

I\'m in college, and for a project we\'re using C. We\'ve explored GCC and Clang, and Clang appears to be much more user friendly than GCC. As a result, I\'m wondering what

6条回答
  •  感动是毒
    2020-12-22 16:31

    I use both Clang and GCC, I find Clang has some useful warnings, but for my own ray-tracing benchmarks - its consistently 5-15% slower then GCC (take that with grain of salt of course, but attempted to use similar optimization flags for both).

    So for now I use Clang static analysis and its warnings with complex macros: (though now GCC's warnings are pretty much as good - gcc4.8 - 4.9).

    Some considerations:

    • Clang has no OpenMP support, only matters if you take advantage of that but since I do, its a limitation for me. (*****)
    • Cross compilation may not be as well supported (FreeBSD 10 for example still use GCC4.x for ARM), gcc-mingw for example is available on Linux... (YMMV).
    • Some IDE's don't yet support parsing Clangs output (QtCreator for example *****). EDIT: QtCreator now supports Clang's output
    • Some aspects of GCC are better documented and since GCC has been around for longer and is widely used, you might find it easier to get help with warnings / error messages.

    ***** - these areas are in active development and may soon be supported

提交回复
热议问题