[Development] [Proposal] Replace size related parameters with size_t

Thiago Macieira thiago.macieira at intel.com
Wed Dec 25 00:21:55 CET 2013


On terça-feira, 24 de dezembro de 2013 19:26:27, Kurt Pattyn wrote:
> QString, QByteArray, QList, aso often use sign integers to store sizes,
> indexing, aso. This often leads to signed/unsigned mismatches and is not
> really according standard practice. 

No, they don't. That's why we use int everywhere: no mismatch if they're all 
the same type.

> Also, this restricts the indexes, sizes, aso to 32-bit.

Right.

> One solution to resolve the signed/unsigned mismatch is to cast the types to
> the appropriate type, but this can be dangerous, and hides the real
> problem.
> 
> A better approach would be to use std::size_t.

Not going to happen. This has been discussed time and again. We don't want it, 
it's not going to be done in Qt. Please check the discussions about this from 
two years ago.

> My proposal is to replace all int types with size_t where appropriate.

Maybe Qt 7.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- 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://lists.qt-project.org/pipermail/development/attachments/20131224/8140cc71/attachment.sig>


More information about the Development mailing list