Skip to content

fix(gcc): use os.devnull for the analyzer output file - #5180

Merged
bruntib merged 1 commit into
Ericsson:masterfrom
pcbeingused333:fix/gcc-devnull-windows
Nov 9, 2026
Merged

bruntib merged 1 commit into
Ericsson:masterfrom
pcbeingused333:fix/gcc-devnull-windows

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Fixes problem 1 of #5165 (can't create /dev/null on Windows); problems 2 and 3 are not addressed here, so the issue should stay open.

Root cause: Gcc.construct_analyzer_cmd hardcodes -o/dev/null to 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 (NUL on 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_devnull checks the -o argument follows os.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.

The GCC analyzer hardcoded -o/dev/null, which GCC cannot create on
Windows, so every file failed to analyze. Use os.devnull instead.
@bruntib

bruntib commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Thank you for the fix!

@bruntib
bruntib merged commit 6d73716 into Ericsson:master Nov 9, 2026
10 checks passed
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.

2 participants