[PATCH] D107304: [clangd][query-driver] Extract GCC version from the driver output

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 3 09:51:31 PDT 2021


ArcsinX added a comment.

@kadircet Thanks for clarification. Now your position is clear for me.

But clang was designed as a drop-in replacement for GCC:

- https://clang.llvm.org/docs/LanguageExtensions.html#introduction
- https://clang.llvm.org/features.html#gcccompat

I do not have any proves that clang is 100% compatible with any GCC version, but also I can't find any evidence that the most compatible version of GCC is 4.2.1

I really faced the problem with that default 4.2.1 on a project: strange errors in clangd and it was really hard to understand that the reason was `__GNUC__ == 4`. `-fgnuc-version=<real GCC version here>` addition helped me to solve this. That's why I think that it can be added automatically (and `.clangd` can be used to override this with `4.2.1` (or any other) if user doesn't want this automatic GCC version detection =) )


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107304/new/

https://reviews.llvm.org/D107304



More information about the cfe-commits mailing list