Proposal: USE_GNU89 switch

Ed Schouten ed at 80386.nl
Fri May 29 12:36:35 UTC 2009


Hi folks,

As some of you may have heard, Erwin Lansing (droso) has been helping us
folks from the FreeBSD-Clang project [1] to build an entire ports tree
with Clang.

Even though we're hitting some compiler bugs (crashes, miscompilations,
etc), things have been going very good. We noticed there is a certain
class of build errors we're seeing, namely related to GNU or ISO C99
style inlining.

GCC supported the `inline' keyword long before ISO standardized it, but
unfortunately the semantics between GNU and ISO C99 style inlining are
not the same. GCC solved this by using ISO C99 style inlining, only when
-std=c99 or -std=gnu99 is passed to the compiler. By default it will use
-std=gnu89. Clang does a good job at emulating this, but the difference
is that it uses gnu99 by default. This is very good in my opinion. ISO
C99 is 10 years old.

We've noticed some ports (probably less than 100) really depend on
GNU-style inlining. One option would be to just ignore the issue, but
this will cause problems in the future anyway (by the time GCC itself
will switch to gnu99). This is why I'm proposing a USE_GNU89 switch, to
force the ports framework to add -std=gnu89 to the CFLAGS.

I've been looking through /usr/ports/Mk. I suspect such a switch should
be added to bsd.gcc.mk? I'm sending this message to gerald@ as well,
because I've been told he is the maintainer of various GCC related bits.

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/

[1] http://wiki.freebsd.org/BuildingFreeBSDWithClang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20090529/6c90acc2/attachment.pgp


More information about the freebsd-ports mailing list