From owner-freebsd-current@FreeBSD.ORG Tue Mar 5 14:54:31 2013 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0853C5C9; Tue, 5 Mar 2013 14:54:31 +0000 (UTC) (envelope-from fbsd@opal.com) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) by mx1.freebsd.org (Postfix) with ESMTP id B5854640; Tue, 5 Mar 2013 14:54:30 +0000 (UTC) Received: from pool-141-154-241-44.bos.east.verizon.net ([141.154.241.44] helo=homobox.opal.com) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1UCtG9-0005Lc-Fu; Tue, 05 Mar 2013 14:54:29 +0000 Received: from shibato (shibato.opal.com [IPv6:2001:470:8cb8:4:221:63ff:fe5a:c9a7]) (authenticated bits=0) by homobox.opal.com (8.14.4/8.14.4) with ESMTP id r25EsPJr098415 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 5 Mar 2013 09:54:26 -0500 (EST) (envelope-from fbsd@opal.com) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 141.154.241.44 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/vHzpbUBo+Diki6afP8DGR Date: Tue, 5 Mar 2013 09:54:17 -0500 From: "J.R. Oldroyd" To: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= Subject: Re: r247835: drm2 code breaks buildkernel Message-ID: <20130305095417.3780d487@shibato> In-Reply-To: <5135FD78.1050608@FreeBSD.org> References: <5135C70B.50906@zedat.fu-berlin.de> <5135CD0E.8040801@dumbbell.fr> <5135DE36.9010303@zedat.fu-berlin.de> <20130305123016.GE1483@glenbarber.us> <5135FD78.1050608@FreeBSD.org> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.6; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/LV0HoYyJMfi6yq1=m=elJd9"; protocol="application/pgp-signature" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (homobox.opal.com [IPv6:2001:470:8cb8:4::1]); Tue, 05 Mar 2013 09:54:26 -0500 (EST) X-Spam-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, RP_MATCHES_RCVD shortcircuit=no autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on homobox.opal.com Cc: Konstantin Belousov , freebsd-current@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 05 Mar 2013 14:54:31 -0000 --Sig_/LV0HoYyJMfi6yq1=m=elJd9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 05 Mar 2013 15:13:12 +0100 Jean-S=C3=A9bastien P=C3=A9dron wrote: > > On 05.03.2013 13:30, Glen Barber wrote: > > dev/drm2/ttm/ttm_lock.h:208: warning: redundant redeclaration of 'ttm_w= rite_unlock' [-Wredundant-decls] > > dev/drm2/ttm/ttm_lock.h:134: warning: previous declaration of 'ttm_writ= e_unlock' was here > > dev/drm2/ttm/ttm_lock.h:220: warning: redundant redeclaration of 'ttm_w= rite_lock' [-Wredundant-decls] > > dev/drm2/ttm/ttm_lock.h:146: warning: previous declaration of 'ttm_writ= e_lock' was here >=20 > Those redundant declarations weren't spotted by clang. >=20 > Konstantin, would you like me to commit the fix for this? And we need to > upstream it too. >=20 A fix for these is in my big "get it to compile" patch that I emailed you both the other day. > > dev/drm2/ttm/ttm_page_alloc.c:122: warning: declaration does not declar= e anything > > dev/drm2/ttm/ttm_page_alloc.c:123: warning: declaration does not declar= e anything >=20 > These errors and the following are caused by unnamed structs and unions > inside another struct: >=20 > struct ttm_pool_manager { > ... >=20 > union { > struct ttm_page_pool pools[NUM_POOLS]; > struct { > ... > } ; > }; > }; >=20 > With default options, clang accepts this but apparently, not gcc. > Experimentation shows that this warning is triggered because we use -std=3Diso9899:1999. It can be turned off again by adding --ms-extensions too. Alternatively, my big patch replaces all these anon unions with named ones. There are lots of these in this code, though. Doing this adds lots of patch bloat. > I would like an opinion from the toolchain gurus, because I don't know > what's the proper way to fix this one. >=20 > J.R. Oldroyd CC'd, because he started to work on radeonkms backport to 9 > and faced exactly those issues. >=20 There is a further problem not mentioned here. Three of the files make use of a pointer to a volatile int but later cast this to a (void *). Because we also have -Wcast-qual, this cast triggers "cast discards qualifier on pointer target type" warnings and because of -Werror, this then aborts. What's the best way to fix that? -jr --Sig_/LV0HoYyJMfi6yq1=m=elJd9 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlE2ByEACgkQls33urr0k4l3fACgnznkytk2+2Omhg3BC/gvaJy2 ezUAoJdDkaA74VojMDWiE0tRknHUh8Fd =klTb -----END PGP SIGNATURE----- --Sig_/LV0HoYyJMfi6yq1=m=elJd9--