KEMBAR78
Fix various -Wformat warnings on 32-bit archs by dwatteau · Pull Request #4961 · scummvm/scummvm · GitHub
Skip to content

Conversation

@dwatteau
Copy link
Contributor

Some -Wformat warnings show up in the build logs of some of our 32-bits ports (such as Android 32 bit, Dreamcast, Debian i686…), when calling a printf-like function with something like %ld and an argument that's not guaranteed to be the same size as a long by default.

This is a proposal for fixing this.

The general idea is just to use an explicit cast to long, since it looks like this is what is done in general in the codebase (?), and AFAICS the impacted engines are for older games with no real-world possibility of 64-bit file offsets, especially for some simple debug output. Casting to long long is another possibility (which is potentially even better), but I just tried to follow the existing "style" of each component.

@sev-
Copy link
Member

sev- commented May 14, 2023

Thank you!

@sev- sev- merged commit f5a5057 into scummvm:master May 14, 2023
@dwatteau dwatteau deleted the fix/various-Wformat-warnings branch May 15, 2023 14:37
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.

2 participants