Why does clang -dumpversion report 4.2.1
问题 I was trying to use -dumpversion to determine if the compiler is usable. My project compiles with clang and newer gccs, but not with the old gcc 4.2.1. So why does clang pretend to be an old gcc? Extra questions, is it possible to change this value at runtime? Or does anyone have a nice autoconf macro to determine the compiler version with both clang and gcc? 回答1: Clang was originally written to be compatible with gcc 4.2.1. There has been some discussion about updating that number earlier