Difference between GCC CLang

7
Unix-based systems (a large majority) usually use GCC , to compile the files in C , but also have the CLang for the same purpose.

  

Is there a difference in compiling a project using GCC and CLang ?

    
asked by anonymous 26.07.2016 / 03:23

1 answer

1

To answer your question we need to make a brief reflection.

  • -O CLang is only about the front-end , "let's say it basically handles with the options and paths of links to the files ", for the compilation itself, it uses LLVM which is responsible for the lexical analysis, syntax and semantics of the compilation process. GCC is a complete set with front-end and back-end .

  • Summary of Clang Options although it has many basic basic options , also contains compile options other than GCC Options Summary .

  • GCC beyond C, C ++, Objective-C, has front-end for other languages such as [Fortran, Java, Ada, and more recently Go], names can change as g ++ and GFortran but are still part of the GCC project. However, Clang has a front-end only for C (C ++, Objective C and Objective C ++) languages.
  • Because LLVM and GCC are different compilers, they have different implementations, so the order of the basic set of instructions generated is different. This affects both the compile time, since they have different implementations, and how long to run a program, as they go through different optimization steps and generate different basic instructions.
  •   

    Well said this, I hope it has become clear that although the basic commands   compile a program using GCC is different from compiling   a program using Clang + LLVM.

        
    03.08.2016 / 16:46