From kde-core-devel Mon Jul 04 17:31:09 2011 From: Michael Pyne Date: Mon, 04 Jul 2011 17:31:09 +0000 To: kde-core-devel Subject: Re: -Wunused-but-set-variable warnings Message-Id: <2673077.CkjUNdZycd () midna> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=130980070810783 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart2933431.jescoY5SxN" --nextPart2933431.jescoY5SxN Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Monday, July 04, 2011 12:02:47 Dawit A wrote: > The following files all contain set but unused variables: >=20 > kdelibs/kdecore/util/kshareddatacache.cpp:751:14: warning: variable > =E2=80=98freedPagesRequired=E2=80=99 set but not used [-Wunused-but-s= et-variable] Thanks for the heads-up on this one! > Unlike the -Wunused-parameter fixing this warning messages requires > context because the variable may be set and unused due to a mistake > that can potentially be causing a bug. In this case it was not, but as you point out that was only due to othe= r=20 things going on afterwards. > As such can kdelibs cmake file > be changed to error out, -Werror=3Dunused-but-set-variable, for such > warnings ? I really kind of abhor -Werror in all of its incarnations. It's like ho= lding a=20 whole village hostage until one man gives themselves up to the posse. I= n this=20 case it would affect /anyone/ trying to simply build KDE (even if they = have=20 more advanced compilers with more warnings generated than the developer= who=20 would need to make the fix). Being unable even to build kdelibs, kde-workspace, etc. would make it v= ery=20 difficult for other developers to properly build and *test* the code th= at they=20 are working on elsewhere. So while we should certainly apply social pre= ssure=20 to compile without warnings and ensure bug-free code, don't overdo it! = The=20 likely thing to come from such a decision is that the warnings are "fix= ed" by=20 hastily-applied patches that either do not fix the problem, or possibly= even=20 introduce new ones. I almost broke KSharedDataCache in a way I wouldn't have been able to e= asily=20 test until I took a bit more time to think about what the code was actu= ally=20 doing now, and needed to be doing. Regards, - Michael Pyne --nextPart2933431.jescoY5SxN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABCAAGBQJOEfjdAAoJEAuvDJx7auny7iQP+wbX1Cox+N/B/Eyh83k8g4al IeRMKJ0/qhCncHSNmW2XB0MyUgpKW29kk3n4M6jfJVxlvjqFBLNhTJeCpxamRpLw zNDHZwZChiO1fLmIO6/a1D4XK7tdqgm8Tgx32s+EyD9UaofMuq+PVuov7KLHgAH/ W8JC4I8wLrkei1wJJ/4sXyRDlkm07kos52r4tRAqaF1754Dawt53IO7SLvmbRk9i +9Ig7xs8pXj14VlIhCdBrHhi/yl4gdkVAHHOMnW6TTKwB31x4UoG7AbFnCuA9hu8 OS1Cno66EcFOn1h2lVCP6Is1mYVqw/K53ywbh65OU1UcdwPYIMnc5KI1HJXKIAoy l5mUKmP80gsKfDi8wZJuypsthz9H5uTIFgXCzG06Y1ZuhFqRgnEPIfuttNNOBP5S xJjDTtFWjI4uY99EUZtKZVWTJdyZhZuU7OpX0RJFREx+rXl6RS7G0TVY2Pua6En3 hNKdpTsNAs6toG8M6bF/lrwbyVtzBYNwvkaPCc82ayKx6Rog/tphSHgoMJUR5jTY rm+qngsjkOJ0KSg1dUDGjyxtRSTG0FSXNFZjTh5EIOFsmkHH2L2dluyVhtuCeVF1 ZHEwUSba7+LaOcOwB/PJGjVmFW7JyTj6SC4sj+wVM9853rIfUZnSSSS3dxTBHs7B L2sIgYqw7hxX9u5lpCS6 =+0fJ -----END PGP SIGNATURE----- --nextPart2933431.jescoY5SxN--