catchorg/Catch2

Refactor and centralize compiler detection

Offen

#2.094 geöffnet am 03.11.2020

 (12 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (3.228 Forks)batch import
DevelopmentGood First IssueTweak request

Repository-Metriken

Stars
 (20.381 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 1T 8h) (1 gemergte PR in 30 T)

Beschreibung

Currently Catch2 detects compilers ad-hoc, at the place where the code needs to be compiler-specific. This brings a lot of trouble with more obscure compilers, because compilers like to masquerade for different compilers, such as Clang defining GCC-version macros, ICC defining both, IBM XL self-reporting as Clang, and so on. Because compiler-specific sections of code are often indeed compiler-specific, not detecting compilers properly can be a problem, e.g. Clang will complain that it found unknown pragma if we try to disable GCC-specific warning without checking that Clang is not used.

The solution is to perform more rigorous compiler detection, and centralize it, so that updates don't have to be done in multiple places.

Contributor Guide