Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integer truncation warnings on 64-bit MSVC #78

Open
nyanpasu64 opened this issue Jun 3, 2020 · 2 comments
Open

Integer truncation warnings on 64-bit MSVC #78

nyanpasu64 opened this issue Jun 3, 2020 · 2 comments

Comments

@nyanpasu64
Copy link

This issue is on both verdigris master and 1.2.

In https://github.com/woboq/verdigris/blob/master/src/wobjectimpl.h, there are three occurrences of *stringLengthP++ = s.size();. On 64-bit MSVC, the first two occurrences have the following warning:

C:\Users\nyanpasu\code\exotracker\3rdparty\verdigris\wobjectimpl.h:616: warning: C4244: '=': conversion from 'QIntegerForSize<8>::Signed' to 'int', possible loss of data

Do you think it's worth inserting an explicit cast?

@ogoffart
Copy link
Member

ogoffart commented Jun 3, 2020

Yes, we could add cast to silence the warning.

@nyanpasu64
Copy link
Author

Forgot to mention, I'm not sure why the third occurrence has no warning, and maybe compiles even with /WX (aka -Werror) and without a cast. Might be a better idea to cast it anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants