Date: Tue, 5 Mar 2013 09:54:17 -0500 From: "J.R. Oldroyd" <fbsd@opal.com> To: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= <dumbbell@FreeBSD.org> Cc: Konstantin Belousov <kostikbel@gmail.com>, freebsd-current@FreeBSD.org 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>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <dumbbel= l@FreeBSD.org> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130305095417.3780d487>