From owner-freebsd-current@FreeBSD.ORG Mon Sep 24 09:36:29 2012 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B557106566B for ; Mon, 24 Sep 2012 09:36:29 +0000 (UTC) (envelope-from ohartman@zedat.fu-berlin.de) Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by mx1.freebsd.org (Postfix) with ESMTP id 118B78FC12 for ; Mon, 24 Sep 2012 09:36:28 +0000 (UTC) Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost1.zedat.fu-berlin.de (Exim 4.69) for freebsd-current@FreeBSD.org with esmtp (envelope-from ) id <1TG55R-002BLc-Mf>; Mon, 24 Sep 2012 11:36:21 +0200 Received: from e178019000.adsl.alicedsl.de ([85.178.19.0] helo=thor.walstatt.dyndns.org) by inpost2.zedat.fu-berlin.de (Exim 4.69) for freebsd-current@FreeBSD.org with esmtpsa (envelope-from ) id <1TG55R-0043BJ-Iz>; Mon, 24 Sep 2012 11:36:21 +0200 Message-ID: <50602990.2090408@zedat.fu-berlin.de> Date: Mon, 24 Sep 2012 11:36:16 +0200 From: "O. Hartmann" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120910 Thunderbird/15.0.1 MIME-Version: 1.0 To: Current FreeBSD X-Enigmail-Version: 1.4.3 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigAFFB936031E1C40FF0ECFF94" X-Originating-IP: 85.178.19.0 Cc: Subject: CLANG versus GCC question: compiling non-c99 code with CLANG (clang dumps error) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Sep 2012 09:36:29 -0000 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--