How can I find the actual Clang version on Mac?
launch terminal and enter:
Apple clang version 11.0.0 (clang-118.104.22.168)
This wikipedia table maps Xcode and Apple clang versions to LLVM versions. Your clang-902.0.39.1 appears to be based on LLVM 5.0.2.
You could try using
echo | clang -dM -E - | grep __clang
and maybe that will give you more reliable numbers. Although I'm speculating since I'm not on a Mac.
Also, clang has had the
-pedantic option for a long long time - many versions before 6.0.
-pedantic is a GCC option and clang takes after GCC in its options.
Lone Learner 3 months
Note: None of the answers provided at Get Apple clang version and corresponding upstream LLVM version seems to work anymore.
But on my macOS High Sierra version 10.13.3, I see this output:
$ clang --version Apple LLVM version 9.1.0 (clang-902.0.39.1) Target: x86_64-apple-darwin17.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin $ which clang /usr/bin/clang
This does not seem right. Why is the Apple's version of Clang greater than the current version of Clang?
How do I find out which version of Clang hosted on http://releases.llvm.org/download.html does my Mac's version of Clang correspond to?
I ask this because I see http://releases.llvm.org/6.0.0/tools/clang/docs/UsersManual.html documenting a
-pedanticoption for the
clangcommand line, but it is not documented in the man page of
clangon my system.
$ man clang | grep pedantic $ clang --help | grep pedantic $
ng10 over 2 yearsor g++ --version if you are using g++
Vittore Marcas 8 monthsThis answer takes me eight hours. But I think, Leave enough blank lines between each sentence to make it clearer. If I sacrifice the necessary blank lines, then I can edit it again.