Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 May 2009 14:36:33 +0200
From:      Ed Schouten <ed@80386.nl>
To:        ports@FreeBSD.org
Cc:        gerald@FreeBSD.org
Subject:   Proposal: USE_GNU89 switch
Message-ID:  <20090529123633.GM48776@hoeg.nl>

next in thread | raw e-mail | index | archive | help

--Cy+5HEalSgyXkpVS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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=3Dc99 or -std=3Dgnu99 is passed to the compiler. By default it will use
-std=3Dgnu89. 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=3Dgnu89 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.

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

[1] http://wiki.freebsd.org/BuildingFreeBSDWithClang

--Cy+5HEalSgyXkpVS
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkof1tEACgkQ52SDGA2eCwVB9ACdGp8Ge+aouM5CSS2kuUV3prb9
w8sAn10ZaxjtSMWkjmE8TRPb6utUY6br
=I7Dc
-----END PGP SIGNATURE-----

--Cy+5HEalSgyXkpVS--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090529123633.GM48776>