[PR #1190] [MERGED] Fix C4334 warnings when building with MSVC #1753

Open
opened 2026-01-29 20:55:38 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/google/brotli/pull/1190
Author: @jkoritzinsky
Created: 8/27/2024
Status: Merged
Merged: 11/15/2024
Merged by: @copybara-service[bot]

Base: masterHead: warnings-cleanup


📝 Commits (1)

  • aa54821 Fix C4224 warnings when building with MSVC

📊 Changes

4 files changed (+11 additions, -11 deletions)

View changed files

📝 c/dec/decode.c (+3 -3)
📝 c/enc/compound_dictionary.c (+2 -2)
📝 c/enc/encode.c (+2 -2)
📝 c/enc/hash.h (+4 -4)

📄 Description

Currently, brotli emits C4334 warnings about implicit widening of shift results when building Brotli with MSVC for 64-bit targets with at least warning level 3 enabled.

This PR addresses the warnings by adding casts where necessary to widen before shifting (which seemed like the correct solution for all of the cases).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/google/brotli/pull/1190 **Author:** [@jkoritzinsky](https://github.com/jkoritzinsky) **Created:** 8/27/2024 **Status:** ✅ Merged **Merged:** 11/15/2024 **Merged by:** [@copybara-service[bot]](https://github.com/apps/copybara-service) **Base:** `master` ← **Head:** `warnings-cleanup` --- ### 📝 Commits (1) - [`aa54821`](https://github.com/google/brotli/commit/aa54821999c5424d5ceb0244f5d278cc86f55f44) Fix C4224 warnings when building with MSVC ### 📊 Changes **4 files changed** (+11 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `c/dec/decode.c` (+3 -3) 📝 `c/enc/compound_dictionary.c` (+2 -2) 📝 `c/enc/encode.c` (+2 -2) 📝 `c/enc/hash.h` (+4 -4) </details> ### 📄 Description Currently, brotli emits [C4334 warnings](https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4334?view=msvc-170) about implicit widening of shift results when building Brotli with MSVC for 64-bit targets with at least warning level 3 enabled. This PR addresses the warnings by adding casts where necessary to widen before shifting (which seemed like the correct solution for all of the cases). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 20:55:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#1753