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

rar: Fix Visual Studio compiler warning #2188

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

stoeckmann
Copy link
Contributor

Fixes the following warning:

warning C4244: '=': conversion from 'int64_t' to 'size_t', possible loss of data

@stoeckmann
Copy link
Contributor Author

Although this diff looks simple, I'm not sure if the implications here aren't hiding a bug now. Actually this is eventually casted to uint32_t on all systems, yet it's a 64 bit value. Not sure if all systems truncate huge values here...

@stoeckmann
Copy link
Contributor Author

Reviewed the changes again. It seems safe, because the values eventually come from variables of casted type. I don't mind if someone checks again though. The casts from uint64_t to size_t and back again could be interesting, but definitely out of scope of this PR which is about fixing warnings.

@LukeSkyD
Copy link
Contributor

LukeSkyD commented May 22, 2024

Hi thank you for your work!
Im having a similar problem compiling from the source with msvc, i created a pull request which should fix my specific issue but i dont know if it would be safe, sorry can i ask for your help?

#2209

EDIT: sorry it was late last night and didn't see this pr still had to be merged. your commit already tackles the issue.

Fixes the following warning:

warning C4244: '=': conversion from 'int64_t' to 'size_t', possible loss of data
@stoeckmann
Copy link
Contributor Author

Any news on this one or the other PRs? Is there something I can do to support reviews?

@LukeSkyD
Copy link
Contributor

LukeSkyD commented Jun 2, 2024

Any news on this one or the other PRs? Is there something I can do to support reviews?

Yours commit/e0fb6da967f30c398955a364430fa5355c92bdd1 seems to be the most correct solution!

@kientzle kientzle merged commit 9a3bce8 into libarchive:master Jun 3, 2024
18 of 20 checks passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants