[Qt-interest] QSharedMemory::create takes an int... why?
Patrick Vollebregt
jeet.nl at gmail.com
Fri Jul 31 15:51:22 CEST 2009
Thank you, I've decided to file a bug report.
> Patrick Vollebregt wrote:
>
>
>> They could solve it by defining an appropriate type, or use what's
>> already there: size_t
>>
>
> I completely agree.
>
> The API specifies "int". This data type is signed, so the API specifies a
> signed value for an interface in which negative quantities have no
> meaning. It would have been possible to defend "unsigned int", but plain
> "int" is broken.
>
> The debate herein on the length of "int" is further demonstration of its
> poor suitability for this particular interface. It's also worrying to
> witness debate on the behaviour of fundamental C++ data types. The ISO
> standard should be the first and last word on this subject. If reading
> ISO/IEC 14882:2003, please see section 3.9.1.
>
> The suggestion of a "size_t" is sensible. I hope the Qt engineers
> recognise the fault and adopt an appropriate solution. For further
> information, please see ISO/IEC 14882:2003 section 5.3.3. See also:
>
> http://preview.tinyurl.com/mcpnv4
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090731/22515810/attachment.html
More information about the Qt-interest-old
mailing list