RFR: 8362516: Support of GCC static analyzer (-fanalyzer)
Matthias Baesken
mbaesken at openjdk.org
Thu Aug 28 15:23:57 UTC 2025
On Thu, 28 Aug 2025 15:17:47 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> Recent versions of GCC have a static code analyzer option (-fanalyzer) that works quite well for C code (but it has still issues with C++).
> This can be used to identify e.g. some leaks like memory leaks, double close, use of uninitialized data etc. .
> Some info about it :
>
> https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html
> https://developers.redhat.com/articles/2023/05/31/improvements-static-analysis-gcc-13-compiler
Usage is `--enable-static-analyzer --disable-warnings-as-errors` (if warnings as errors are not disabled, we ru n into warnings generated by the analyzer).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26989#issuecomment-3233940427
More information about the build-dev
mailing list