gcc-4.2 vs apple-gcc-4.2

Clemens Lang cal at macports.org
Tue Jan 17 17:07:08 PST 2012


On Tue, Jan 17, 2012 at 05:46:58PM -0600, Ryan Schmidt wrote:
> It's just so tedious. I don't have time to file all these bug reports
> and keep track of what versions of clang work. I'm happy if we can
> commit a fix, any fix, that lets a port compile.

A lot of those problems are only caused by code assuming to be compiled
using GNU89. Since clang assumes C99 as standard, if none is defined, it
behaves different from gcc here (which uses GNU89 then). See [1] for
more information on that.  Most of these issues (you can easily identify
them, since they usually fail at linking with missing symbols) can be
easily fixed be removing the inline keyword or defining a standard, but
still quite a few of them are being "fixed" by switching to llvm-gcc-4.2
instead; so switching to llvm-gcc-4.2 isn't the one-stop-shop solution
for each and every clang problem, especially not in the long run, since
we probably will have to get a long with clang for a good while.

Also, issues like these should be reported upstream to have them fixed
by either specifiying a standard in CFLAGS or fixing the software to be
cross-standard compatible.

[1] http://clang.llvm.org/compatibility.html#inline

-- 
Clemens Lang
GSoC Student



More information about the macports-dev mailing list