Repository navigation
fix(gcc): use os.devnull for the analyzer output file - #5180
Merged
Merged
Conversation
The GCC analyzer hardcoded -o/dev/null, which GCC cannot create on Windows, so every file failed to analyze. Use os.devnull instead.
bruntib
approved these changes
Nov 9, 2026
Contributor
|
Thank you for the fix! |
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.
Fixes problem 1 of #5165 (
can't create /dev/nullon Windows); problems 2 and 3 are not addressed here, so the issue should stay open.Root cause:
Gcc.construct_analyzer_cmdhardcodes-o/dev/nullto discard the object file. On Windows GCC cannot create that path (can't create /dev/null), so analysis fails for every file.Fix: use
os.devnull(NULon Windows) instead. Other problems mentioned in the issue (text before the SARIF output,C:\C:\URIs) are intentionally left out of this PR.Test:
AnalyzerCommandGccTest.test_output_is_os_devnullchecks the-oargument followsos.devnull; it fails before the change and passes after.This change was prepared with the help of an AI coding assistant (Claude Code) and reviewed before submission.