如何在Mac上找到实际的Clang版本? [英] How can I find the actual Clang version on Mac?
问题描述
注意:提供的苹果c都没有答案版本和相应的上游LLVM版本似乎可以正常工作了.
Note: None of the answers provided at Get Apple clang version and corresponding upstream LLVM version seems to work anymore.
位于 http://releases.llvm.org/download.html 的下载页面, https://en.wikipedia.org/wiki/Clang 上的Wikipedia文章似乎表明最新的Clang版本是6.0.0.
The download page at http://releases.llvm.org/download.html and the Wikipedia article at https://en.wikipedia.org/wiki/Clang seems to indicate that the most recent Clang version is 6.0.0.
但是在我的macOS High Sierra版本10.13.3上,我看到以下输出:
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
这似乎不正确.为什么Apple的Clang版本大于当前的Clang版本?
This does not seem right. Why is the Apple's version of Clang greater than the current version of Clang?
如何找出 http://releases.llvm.org/download上托管的Clang版本. .html 我的Mac的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?
之所以这样问,是因为我看到了 http://releases. llvm.org/6.0.0/tools/clang/docs/UsersManual.html 记录了clang
命令行的-pedantic
选项,但是在我的clang
手册页中没有记录系统.
I ask this because I see http://releases.llvm.org/6.0.0/tools/clang/docs/UsersManual.html documenting a -pedantic
option for the clang
command line, but it is not documented in the man page of clang
on my system.
$ man clang | grep pedantic
$ clang --help | grep pedantic
$
推荐答案
此维基百科表将Xcode和Apple clang版本映射到LLVM版本. 您的clang-902.0.39.1似乎基于LLVM 5.0.2.
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.
这篇关于如何在Mac上找到实际的Clang版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!