Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Sep 2012 11:36:16 +0200
From:      "O. Hartmann" <ohartman@zedat.fu-berlin.de>
To:        Current FreeBSD <freebsd-current@FreeBSD.org>
Subject:   CLANG versus GCC question: compiling non-c99 code with CLANG (clang dumps error)
Message-ID:  <50602990.2090408@zedat.fu-berlin.de>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigAFFB936031E1C40FF0ECFF94
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

Hello,

I have a problem and I guess there is a simple solution - at least, I hop=
e.

I try to compile a "in spe" port which contains some C code that is
definitely Kernighan & Ritchie standard like:

--
my_func(win)
Window win;
{
	[...]
	if ( current->win.data =3D=3D (lux_data *)NULL ) return;
	[...]
}
--

There is no declaration of the return type of the function, I guess it
is implicitely void in older standards, but is treated as non void
function in CLANG - and there the error comes in.

I can compile the code without any problems with GCC 4.6 - without any
change of compiling standard or anything like that, it simply compiles.

I tried to apply "CFLAGS+=3D -std=3D[c89|gnu89]" when compiling with CLAN=
G
since GCC defaults to gnu89 while CLANG defaults to c99 standard, but
this didn't help.

What is the magic switch and where to place it?

Thanks in advance and sorry for the "noob" question.

Oliver


--------------enigAFFB936031E1C40FF0ECFF94
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iQEcBAEBAgAGBQJQYCmVAAoJEOgBcD7A/5N8ai8IAK4n+bbgDBwTDR/MxreI9Ee8
wErDu7qhe4IPrRdgB6jreZfl3LsoEpvelOQVqQAwiY4/ixPzkbHvuXA3mDjcrJIj
YTGWDgPjFCBhwUVF7bWC5MSoEwDGf7ejat0RJsQCpVBFJBDwiNG8CmIZSlnh36sK
DzsWIrgcKsrJ3lpC513UDyWdz2DNTBhdHgfqrAD6M4B0jM/hQS0y9x/sccVivrch
ZzUeegzdwGPVCOnLeRV3bNgvGqZ4b7Zw3AZMQoR2LQPdEAX6LQjhE8A6gLa9RGDZ
fW5bfOYnCBxKwA/hePh46X7fejaCLb1RRLzsm/nYNHCwYyDjLaMFG+FclV1ULl8=
=TL3h
-----END PGP SIGNATURE-----

--------------enigAFFB936031E1C40FF0ECFF94--



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