Skip to content

md5sum.h: fix tautological comparison warning on 32-bit systems - #148

Merged
skal65535 merged 1 commit into
webmproject:mainfrom
hasinoff:fix-32bit-tautological-compare
Aug 10, 2026
Merged

md5sum.h: fix tautological comparison warning on 32-bit systems#148
skal65535 merged 1 commit into
webmproject:mainfrom
hasinoff:fix-32bit-tautological-compare

Conversation

@hasinoff

Copy link
Copy Markdown
Contributor

Summary

On 32-bit architectures where std::string::size_type (size_t) is 32-bit, data.size() < (1ull << 32) is tautologically true and causes Clang/GCC to emit -Wtautological-constant-out-of-range-compare under -Werror.

Casting data.size() to uint64_t preserves the 4GB bounds assertion on 64-bit systems while silencing the compiler warning on 32-bit systems.

Explicitly cast data.size() to uint64_t in assert to prevent
-Wtautological-constant-out-of-range-compare warnings on 32-bit builds.
@skal65535
skal65535 merged commit 9f152ed into webmproject:main Aug 10, 2026
6 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.

2 participants