-Wunused-but-set-variable warnings

Jeremy Whiting jpwhiting at kde.org
Fri Jul 8 23:17:29 BST 2011


On Mon, Jul 4, 2011 at 10:02 AM, Dawit A <adawit at kde.org> wrote:

> The following files all contain set but unused variables:
>
> kdelibs/kdecore/io/kar.cpp:109:19: warning: variable ‘uid’ set but not
> used [-Wunused-but-set-variable]
> kdelibs/kdecore/io/kar.cpp:109:24: warning: variable ‘gid’ set but not
> used [-Wunused-but-set-variable]
>
> kdelibs/kdecore/util/kshareddatacache.cpp:751:14: warning: variable
> ‘freedPagesRequired’ set but not used [-Wunused-but-set-variable]
>
> kdelibs/kjsembed/kjsembed/qobject_binding.cpp:336:18: warning:
> variable ‘propSet’ set but not used [-Wunused-but-set-variable]
>
> kdelibs/kdeui/widgets/ktabwidget.cpp:336:15: warning: variable
> ‘overlap’ set but not used [-Wunused-but-set-variable]
>
> kdelibs/kded/kbuildsycoca.cpp:478:21: warning: variable
> ‘servicetypeFactory’ set but not used [-Wunused-but-set-variable]
> kdelibs/kded/kbuildsycoca.cpp:479:28: warning: variable
> ‘mimeTypeFactory’ set but not used [-Wunused-but-set-variable]
>
> kdelibs/experimental/libkdeclarative/bindings/icon.cpp:95:33: warning:
> variable ‘setter’ set but not used [-Wunused-but-set-variable]
>
> kdelibs/nepomuk/utils/dynamicresourcefacet.cpp:81:10: warning:
> variable ‘selectionChanged’ set but not used
> [-Wunused-but-set-variable]
>
> kdelibs/kio/kio/connection.cpp:169:39: warning: variable ‘type’ set
> but not used [-Wunused-but-set-variable]
>
> kdelibs/kio/bookmarks/kbookmarkimporter_opera.cc:51:20: warning:
> variable ‘version’ set but not used [-Wunused-but-set-variable]
>
> kdelibs/kio/kssl/ksslkeygen.cpp:163:6: warning: variable ‘rc’ set but
> not used [-Wunused-but-set-variable]
>
> kdelibs/knewstuff/knewstuff3/staticxml/staticxmlprovider.cpp:199:14:
> warning: variable ‘mode’ set but not used [-Wunused-but-set-variable]
>

Thanks for checking this, that's embarassing, a whole for loop to get a
value we don't even use anymore.  I just fixed it on the master branch of
kdelibs.

Jeremy


>
> kdelibs/interfaces/kimproxy/library/kimproxy.cpp:285:8: warning:
> variable ‘newApp’ set but not used [-Wunused-but-set-variable]
>
> kdelibs/kde3support/kdeui/k3dockwidget.cpp:3108:10: warning: variable
> ‘isOverMainWdg’ set but not used [-Wunused-but-set-variable]
>
> kdelibs/plasma/framesvg.cpp:686:16: warning: variable ‘pos’ set but
> not used [-Wunused-but-set-variable]
> kdelibs/plasma/private/applethandle.cpp:316:13: warning: variable
> ‘separator’ set but not used [-Wunused-but-set-variable]
> kdelibs/plasma/private/applethandle.cpp:403:13: warning: variable
> ‘separator’ set but not used [-Wunused-but-set-variable]
> kdelibs/plasma/widgets/iconwidget.cpp:1193:15: warning: variable
> ‘labelRect’ set but not used [-Wunused-but-set-variable]
> kdelibs/plasma/widgets/scrollwidget.cpp:673:14: warning: variable
> ‘moved’ set but not used [-Wunused-but-set-variable]
>
> kdelibs/experimental/libkdeclarative/bindings/icon.cpp:95:33: warning:
> variable ‘setter’ set but not used [-Wunused-but-set-variable]
>
> kdelibs/khtml/html/htmltokenizer.cpp:1724:18: warning: variable
> ‘endTag’ set but not used [-Wunused-but-set-variable]
> kdelibs/khtml/rendering/bidi.cpp:1735:16: warning: parameter
> ‘cleanLineBidiContext’ set but not used [-Wunused-but-set-parameter]
> kdelibs/khtml/rendering/render_image.cpp:366:9: warning: variable
> ‘m_height’ set but not used [-Wunused-but-set-variable]
> kdelibs/khtml/rendering/table_layout.cpp:393:23: warning: variable
> ‘last’ set but not used [-Wunused-but-set-variable]
> kdelibs/khtml/rendering/table_layout.cpp:917:10: warning: variable
> ‘haveRelative’ set but not used [-Wunused-but-set-variable]
> kdelibs/khtml/rendering/render_canvasimage.cpp:77:10: warning:
> variable ‘drawSelectionTint’ set but not used
> [-Wunused-but-set-variable]
> kdelibs/khtml/css/css_webfont.cpp:498:10: warning: variable
> ‘foundLocal’ set but not used [-Wunused-but-set-variable]
> kdelibs/khtml/editing/jsediting.cpp:616:33: warning: variable ‘it’ set
> but not used [-Wunused-but-set-variable]
> kdelibs/khtml/svg/graphics/qt/SVGResourceClipperQt.cpp:49:10: warning:
> variable ‘heterogenousClipRules’ set but not used
> [-Wunused-but-set-variable]
> kdelibs/khtml/rendering/RenderSVGRoot.cpp:94:13: warning: variable
> ‘oldBounds’ set but not used [-Wunused-but-set-variable]
> kdelibs/khtml/rendering/SVGRootInlineBox.cpp:506:13: warning: variable
> ‘textWidth’ set but not used [-Wunused-but-set-variable]
> kdelibs/khtml/rendering/SVGRootInlineBox.cpp:1223:22: warning:
> variable ‘lastCharacter’ set but not used [-Wunused-but-set-variable]
>
> 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. As such can kdelibs cmake file
> be changed to error out, -Werror=unused-but-set-variable, for such
> warnings ?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110708/e22cadcc/attachment.htm>


More information about the kde-core-devel mailing list