Skip to content

Avoid crc32 narrowing warning - #1288

Open
bmehta001 wants to merge 1 commit into
madler:developfrom
bmehta001:fix-crc32-clang-narrowing
Open

Avoid crc32 narrowing warning#1288
bmehta001 wants to merge 1 commit into
madler:developfrom
bmehta001:fix-crc32-clang-narrowing

Conversation

@bmehta001

Copy link
Copy Markdown

Fixes #1287.

crc is masked to 32 bits before the braided path, so this conversion is intentional. Make it explicit to avoid the Clang -Wshorten-64-to-32 warning.

Tested with a Clang build using -Wshorten-64-to-32 -Werror, followed by the CMake tests on Linux and Windows.

The CRC is already masked to 32 bits, but Clang still diagnoses the implicit conversion from uLong to z_crc_t under -Wshorten-64-to-32. Make the intended narrowing explicit.

Files changed:
- crc32.c

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6b269873-a7bf-490e-a412-70a920868135
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.

crc32.c triggers -Wshorten-64-to-32 with Clang

1 participant