[Interest] Need argumentative help..... giving qobject copy/assignment constructor and put it in qlist/qmap

Jérôme Godbout jerome at bodycad.com
Thu Jul 23 15:21:13 CEST 2015


C4244 is particulary true since Qt mostly use int for every size matter,
which on 64 bits system generate a lot of warnings when connecting to Qt. I
hope we see a size_t or equivalent some day. I admit the int to unsigned
int is also a problem to become, -1 lead to 2^32 - 1, we can only do that
if you known negative number aren't used and should do a static_cast
or reinterpret_cast according to the situation and handle the conversion
properly.

C4244 should not be suspended, it's a true problem if the system ever reach
limit condition on those value. If you ever had the "chance" to debug a
case where this happen, you known this warning have it's purpose.

On Thu, Jul 23, 2015 at 1:57 AM, Gunnar Roth <gunnar.roth at gmx.de> wrote:

>
> Am 23.07.2015 um 07:51 schrieb Bo Thorsen <bo at vikingsoft.eu>:
>
> Den 23-07-2015 kl. 00:07 skrev Thiago Macieira:
>
> Disabling C4244 /* conversion from 'type1' to 'type2', possible loss of
> data
>
> */ is more than going to far. It is kind of sabotage imho.
>
> Note that this does not apply to 64-bit to 32-bit conversions. Those are
> still
> active, so C4244 does not seem to apply to them. I don't know what it
> applies
> to.
>
>
> I think this one warns on "float f = 2.0;".
>
> In this particular instance, it's pretty dumb. 2.0 is perfectly fine
> inside a float. But it just warns every time you store a double in a
> float without trying to be clever about when you should receive the
> warning.
>
> I think, reading documentation is better than thinking ;-)
>
> https://msdn.microsoft.com/en-us/library/2d7604yb.aspx
>
> Compiler Warning (level 2) C4244
> argument' : conversion from 'type1' to 'type2', possible loss of data
>
> A floating point type was converted to an integer type. A possible loss of
> data may have occurred.
> https://msdn.microsoft.com/en-us/library/th7a07tz.aspx
> Compiler Warning (levels 3 and 4) C4244
> 'conversion' conversion from 'type1' to 'type2', possible loss of data
>
> An integer type is converted to a smaller integer type. This is a level-4
> warning if *type1* is int and *type2* is smaller than int. Otherwise, it
> is a level 3 (assigned a value of type __int64
> <https://msdn.microsoft.com/en-us/library/29dh1w7z.aspx> to a variable of
> type unsigned int). A possible loss of data may have occurred.
> Regards,
> Gunnar Roth
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150723/9f757b0f/attachment.html>


More information about the Interest mailing list