If you're compiling on OSX and haven't installed gcc
, Apple has provided clang
pretending to be gcc
. The pretense isn't very good, since there are a lot of differences in warnings (and exit-codes). You can see what you are running using
gcc --version
and (for instance ‐ I have installed gcc using MacPorts under /opt
):
$ path -lL gcc
-rwxr-xr-x 3 root admin 1131416 Jun 10 2016 /opt/local/bin/gcc
-rwxr-xr-x 1 root wheel 18176 Jul 8 22:52 /usr/bin/gcc
$ /opt/local/bin/gcc --version
gcc (MacPorts gcc5 5.4.0_0) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ /usr/bin/gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
As you can see, /usr/bin/gcc
is really clang
, and (barring Apple improving things further), will produce similar messages.