-Wunused-but-set-variable warnings

Thiago Macieira thiago at kde.org
Tue Jul 5 14:46:04 BST 2011


Em Monday, 4 de July de 2011, às 12:02:47, Dawit A escreveu:
> 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 ?

Don't forget the case where the variable is set as a result of a function call 
that has side-effects. If that's the case, you may remove the variable, but you 
cannot remove the function call.

We caused a couple of regressions in Qt due to this mistake.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110705/3f741c7f/attachment.sig>


More information about the kde-core-devel mailing list