Holger Schurig on Nostr: npub1fzx00…wt6h3 They are two different compilers. Sometimes one is faster, ...
npub1fzx00c36ny4whyuhg4ykx6987wxp885fmwmc784n27qcu6pavwzs3wt6h3 (npub1fzx…t6h3) They are two different compilers. Sometimes one is faster, sometimes the other, but basically they are equivalent, i.E. you cannot say "compile all with X and your programs are 20% faster". The clang suite has things like clazy (code style checker), scan-build (static analyzer), the C source code formatter and all of this built into the language server "clangd" that the GCC suit is lacking. On the other side, for Linux programs GCC is more batle proofed because all distros are compiled by default with GCC.
Clangs static analyzer is however more advanced than the GCC one.
Also they spit out slightly different warnings. For that reason some CI/CD environments use both. I similarly do that by using clangd via eglot (so I get its warnings and checks first) and GCC for the actual compile step. I program in a style that no compiler spits out any warning at all. That makes the programs somewhat robust.
But still not as robust as using the (glacially slow) Rust compiler, or the (slow when you have maaaaany source files) Nim compiler.
Clangs static analyzer is however more advanced than the GCC one.
Also they spit out slightly different warnings. For that reason some CI/CD environments use both. I similarly do that by using clangd via eglot (so I get its warnings and checks first) and GCC for the actual compile step. I program in a style that no compiler spits out any warning at all. That makes the programs somewhat robust.
But still not as robust as using the (glacially slow) Rust compiler, or the (slow when you have maaaaany source files) Nim compiler.