Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cswrap-core: skip known wrappers while invoking an analyzer #44

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

kdudka
Copy link
Member

@kdudka kdudka commented Jul 19, 2024

We want to hook gcc -fanalyzer on clang if clang is used as the system compiler. However, it does not make sense to hook GCC Analyzer on clang --analyze, which is invoked by csclng while wrapping gcc as the system compiler.

Apart from wasting resources by running multiple processes of GCC Analyzer in parallel, this was causing unnecessary noise in scan.log as GCC Analyzer complained about unsupported flags, which were injected by csclng for clang --analyze only:

gcc: error: unrecognized command-line option ‘-fno-caret-diagnostics’
gcc: error: unrecognized command-line option ‘-fno-caret-diagnostics’
gcc: error: unrecognized command-line option ‘-fno-caret-diagnostics’

Reported-by: Lukáš Zaoral
Fixes: commit 983b895
Related: #43
Closes: #44

@kdudka kdudka requested a review from lzaoral July 19, 2024 15:38
@kdudka kdudka self-assigned this Jul 19, 2024
Copy link
Member

@lzaoral lzaoral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you, @kdudka!

src/cswrap-core.c Show resolved Hide resolved
src/cswrap-core.c Outdated Show resolved Hide resolved
src/cswrap-core.c Outdated Show resolved Hide resolved
src/cswrap-core.c Show resolved Hide resolved
We want to hook `gcc -fanalyzer` on `clang` if `clang` is used as the
system compiler.  However, it does not make sense to hook GCC Analyzer
on `clang --analyze`, which is invoked by `csclng` while wrapping `gcc`
as the system compiler.

Apart from wasting resources by running multiple processes of GCC
Analyzer in parallel, this was causing unnecessary noise in `scan.log`
as GCC Analyzer complained about unsupported flags, which were injected
by `csclng` for `clang --analyze` only:
```
gcc: error: unrecognized command-line option ‘-fno-caret-diagnostics’
gcc: error: unrecognized command-line option ‘-fno-caret-diagnostics’
gcc: error: unrecognized command-line option ‘-fno-caret-diagnostics’
```

Reported-by: Lukáš Zaoral
Fixes: commit 983b895
Related: csutils#43
Closes: csutils#44
@kdudka
Copy link
Member Author

kdudka commented Jul 23, 2024

@lzaoral Thanks for review!

@kdudka kdudka closed this in 1bbbfa0 Jul 23, 2024
@kdudka kdudka merged commit 1bbbfa0 into csutils:main Jul 23, 2024
26 checks passed
@kdudka kdudka deleted the reduce-forking branch July 23, 2024 13:46
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