Closed iamanonymouscs closed 4 months ago
@llvm/issue-subscribers-clang-static-analyzer
Author: Anonymous (iamanonymouscs)
You need to also enable the alpha.security.ArrayBoundV2
checker. https://godbolt.org/z/1Ynh1YcM6
That is an "alpha" checker as the diagnostics weren't as good as it is today. But even today, those diagnostics can go wild so it's not enabled by default.
But as far as I'm aware of, most tool vendors shipping CSA enable this checker in their default configuration, and CSA is not really suited to be used without some wrapper tool around it to fine tune the configurations, like scan-build
or CodeChecker
.
Probably using such tools would lead to a fairer comparison if your goal was to compare different static analysis tools.
You need to also enable the
alpha.security.ArrayBoundV2
checker. https://godbolt.org/z/1Ynh1YcM6 That is an "alpha" checker as the diagnostics weren't as good as it is today. But even today, those diagnostics can go wild so it's not enabled by default. But as far as I'm aware of, most tool vendors shipping CSA enable this checker in their default configuration, and CSA is not really suited to be used without some wrapper tool around it to fine tune the configurations, likescan-build
orCodeChecker
. Probably using such tools would lead to a fairer comparison if your goal was to compare different static analysis tools.
Thank you so much for your advice! :)
Clang version
It seems that CSA miss diagnostic for buffer overflow and allocated size check. The program is as follow:
GCC's analyzer finds these issues. https://godbolt.org/z/nc55zdjG8
CSA can't find these issues. https://godbolt.org/z/aT6rnnhMT
Is there any clang options that I might have overlooked?