8
The systems based on Unix (a large majority), usually use the GCC, to compile the files in C, but I also possessed the Clang for the same purpose.
There is difference when compiling some project using GCC and Clang?
8
The systems based on Unix (a large majority), usually use the GCC, to compile the files in C, but I also possessed the Clang for the same purpose.
There is difference when compiling some project using GCC and Clang?
1
To answer your question we need to make a brief reflection.
-The Clang deals only with the front-end , "let’s say it deals basically with the options and the links paths to the files, "for the compilation itself, it uses the LLVM which is responsible for the lexical, syntactic and semantic analysis of the compilation process. The GCC is a complete set with front-end and back-end.
The Summary of Clang Options although it has many basic options equal, it also contains compilation options different from Summary of GCC options.
Well said that, I hope it has become clear that although the basic commands be equal, compiling a program using GCC is different from compiling a program using Clang + LLVM.
Just to complement Gabriel’s responsibility, although the code of the final program is different, the result of running the program on both compilers is expected to be the same since they are compiling the same program in the same language.
The first point is all wrong. Clang is a front-end for the C language families (C, C++, Objective-C etc), which takes care of lexical, syntactic and semantic analysis and generates an unadjusted IR. LLVM is a back-end that optimizes and converts IR to some ISA of a target architecture.
Browser other questions tagged c gcc clang
You are not signed in. Login or sign up in order to post.
Clang was designed to be able to replace GCC. It is an open source project with major contributors such as Apple, Microsoft, Google, ARM, Sony, Intel and Advanced Micro Devices (AMD). Website with a comparison between GCC and Clang: http://gcc.gnu.org/wiki/ClangDiagnosticsComparison
– Lacobus
I like to use the
-Weverything
with Clang. Same-Wall -Wextra
with gcc still leaves some warnings disabled.– pmg