Conversation
|
@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
|
@iancha1992 |
| 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] |
There was a problem hiding this comment.
why don't we just remove the unused variable here?
There was a problem hiding this comment.
I thought that we might not want to touch vendored third-party sources. I'm open to dropping the line if you think that's better overall. In that case, should I add a changelog entry to the file comment?
There was a problem hiding this comment.
Yeah, I think we are free to update the def_parser source, there is a patch file there documenting the changes, maybe we could update both the source and the patch file?
There was a problem hiding this comment.
We can do it in another PR, this one is being imported.
### 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 - [ ] I have added tests for the new use cases (if any). - [ ] I have updated the documentation (if applicable). ### Release Notes RELNOTES: None Closes bazelbuild#28748. PiperOrigin-RevId: 874450442 Change-Id: Ic3dd607333de761367d96950ad62a40479162a1b
### 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 - [ ] I have added tests for the new use cases (if any). - [ ] I have updated the documentation (if applicable). ### Release Notes RELNOTES: None Closes #28748. PiperOrigin-RevId: 874450442 Change-Id: Ic3dd607333de761367d96950ad62a40479162a1b Commit 88b78b5 Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
|
The |
|
@bazel-io fork 9.0.1 |
### 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 - [ ] I have added tests for the new use cases (if any). - [ ] I have updated the documentation (if applicable). ### Release Notes RELNOTES: None Closes bazelbuild#28748. PiperOrigin-RevId: 874450442 Change-Id: Ic3dd607333de761367d96950ad62a40479162a1b
### 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 - [ ] I have added tests for the new use cases (if any). - [ ] I have updated the documentation (if applicable). ### Release Notes RELNOTES: None Closes #28748. PiperOrigin-RevId: 874450442 Change-Id: Ic3dd607333de761367d96950ad62a40479162a1b Commit 88b78b5 Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
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