Review Request: ExecState.cpp:225: warning: comparison between signed and unsigned integer expressions

Thiago Macieira thiago at kde.org
Mon Oct 12 15:33:11 BST 2009


Em Segunda-feira 12. Outubro 2009, às 10.57.02, David Jarvie escreveu:
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/1831/#review2612
> -----------------------------------------------------------
> 
> 
> Always use static_cast<size_t>() etc. rather than the C-style (size_t)
>  cast. This is safer in that it only allows casts between compatible types,
>  and has the advantage that it is clearer to people reading the code later
>  that it has been done in a safe way.

Function-style casts are acceptable. E.g:

	size_t(foo)

But try to avoid size_t. Use int wherever you can.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

Qt Developer Days 2009 | Registration Now Open!
Munich, Germany: Oct 12 - 14     San Francisco, California: Nov 2 - 4
      http://qt.nokia.com/qtdevdays2009
-------------- 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/20091012/05731be0/attachment.sig>


More information about the kde-core-devel mailing list