Open
Conversation
Collaborator
Author
|
@bazel-io fork 9.1.0 |
There was a problem hiding this comment.
Pull request overview
This PR fixes clang warnings on Windows that point to legitimate logic bugs and undefined behavior. Compiling with clang instead of MSVC generates more warnings, helping to identify real issues in the codebase.
Changes:
- Fixed constexpr pointer type declarations for string literals
- Removed unused variables and functions
- Corrected struct initialization syntax from
{0}to{}where clang warned - Fixed critical logic bug in
IsStandardTerminal()where wrong handle was being checked - Fixed parameter naming shadowing issue in
SignalHandler::Install()
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/test/windows/tw.cc | Fixed constexpr declaration and removed unused helper functions |
| third_party/def_parser/BUILD | Added compiler flag to suppress unused variable warning (has issue) |
| src/tools/launcher/util/launcher_util.cc | Removed unused size variable from FormatMessageA call |
| src/main/native/windows/processes-jni.cc | Updated LARGE_INTEGER initialization syntax |
| src/main/native/windows/process.cc | Updated struct initialization and removed unused DupeHandle function |
| src/main/cpp/util/errors_windows.cc | Removed unused size variable from FormatMessageA call |
| src/main/cpp/blaze_util_windows.cc | Fixed parameter shadowing, struct initialization, removed unused function, and critically fixed loop variable bug in IsStandardTerminal |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Compiling with clang rather than MSVC generates more warnings on Windows, some of which point to legitimate logic bugs and UB.
9b5ac6e to
07ec973
Compare
meteorcloudy
approved these changes
Feb 23, 2026
Member
|
@iancha1992 |
Wyverald
reviewed
Feb 23, 2026
| hdrs = ["def_parser.h"], | ||
| copts = select({ | ||
| "@rules_cc//cc/compiler:clang": [ | ||
| # third_party/def_parser/def_parser.cc:349:10: warning: unused variable 'size' [-Wunused-variable] |
Member
There was a problem hiding this comment.
why don't we just remove the unused variable here?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Compiling with clang rather than MSVC generates more warnings on Windows, some of which point to legitimate logic bugs, memory safety issues or dead code.
Motivation
Build API Changes
No
Checklist
Release Notes
RELNOTES: None