The main collation of a discussion on self-knowledge:
Currently the industry's three major C + + compilers: visualc++, g++, clang++. visualc++ The main advantage is the graphical interface, debugging is convenient, but the available platform is very limited. This is mainly compared to g++ and clang++.
the advantages of clang than GCC compilers:
· Faster compilation speed
· Smaller compilation output
· The error message is more user-friendly, such as clang can directly point to the relative simplicity of the error location in the compilation process and the way it "thinks" it is right.
· There is a built-in static analysis tool that allows static analysis of code (CLANG-ANALYZE). That's what GCC can't do.
· Because clang only need to complete lexical and grammatical analysis, code optimization and machine code generation work is done by LLVM. So, compared to all the GCC packages, clang can do one thing more intently. This structure also allows clang to be used separately for other applications, as well as embedded C/s + + parser for other apps (primarily the IDE). Code completion and refactoring are important features for the IDE, but if there is no underlying support, only tags parsing or regular expression matching is difficult to achieve, clang is just the role. In this way, the editor tool can use the same parser as compiler to complete the edit-time syntax check. And GCC won't be able to do that easily. For historical reasons, GCC is a single executable compiler that completes the process from preprocessing to final code generation, with many of the information not being reused by other programs.
the advantages of GCC:
· Some software can be clang compiled with a baffling error, but compiling with GCC is possible.
· GCC has been preparing to use C + + for modularity until 5.0, expecting a breakthrough in GCC's 5.0 to make up for a short board that cannot be modularized.