From kde-core-devel Thu Mar 31 18:24:16 2005 From: =?iso-8859-1?q?Andr=E9_W=F6bbeking?= Date: Thu, 31 Mar 2005 18:24:16 +0000 To: kde-core-devel Subject: compiler warnings Message-Id: <200503312024.16240.Woebbeking () onlinehome ! de> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=111229332211163 Hi, I know that from time to time someone suggests to cleanup all compiler warnings and I can only second that. For example I found these two goodies (warning: 'foo' might be used uninitialized in this function): kdebase/kicker/applets/clock/clock.cpp:1626 bool showDate = showDate || (zone->zoneIndex() != 0); if (!showDate && !showDayOfWeek) One additional note, showDate is also a member variable. But AFAIK only the local variable is used in this example otherwise you've to use this->showDate. -Wshadow would be nice for this kind of things, but Qt prevents us from using it :-( kwin/clients/modernsystem/modernsys.cpp: 219 bool showh; int hsize, hwidth, bwidth, theight; KConfig c("kwinmodernsysrc"); c.setGroup("General"); show_handle = c.readBoolEntry("ShowHandle", true); hwidth = c.readUnsignedNumEntry("HandleWidth", 6); hsize = c.readUnsignedNumEntry("HandleSize", 30); if (!(showh && hsize && hwidth)) { showh = false; hwidth = hsize = 0; } I think it should read showh = c.readBoolEntry("ShowHandle", true); I know that most warnings are just warnings but sometimes they help finding errors. But if there're hundreds of warnings you'll oversee the important ones easily. Most warnings in kdelibs and kdebase exist for month now and IMO at least KDE core should be cleaned up. Cheers, André