如何在mac上找到gcc版本

我在mac机器上使用OS 10.9。 我想知道我正在使用的gcc版本。 所以我在终端上尝试了gcc --version ,结果如下:

 $ gcc --version Configured with: --prefix=/Applications/Xcode5-DP.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.1.58) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix 

在输出中,没有与gcc相关的细节,但clang就在那里。 我很困惑gcc命令是执行clang还是gcc(gnu)。

你似乎并没有在你的道路上拥有gcc。 截至Xcode的最新版本,它安装了一个“gcc”,而不是Clang的链接。

Apple提供的工具已从GCC切换到Clang。 为方便起见,gcc命令链接到clang。 在OS X 10.9中,除非您独立于Apple软件包安装了GCC,否则您的系统上没有GCC。

 gcc -dumpversion | cut -f1 -d.