Can I specify multiple `-fdiagnostics-format=FORMAT` at the same time? For example, both `text` and `sarif-file`?

39 views Asked by At

Some time ago, GCC added support for emitting diagnostics in the SARIF format, https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596138.html.

I am building with the -fanalyzer GCC option, so the warnings that get produced can get rather lengthy.

I would like to build with the default text so that I can see in the build log what the compiler is warning about, but at the same time have it create the .sarif files that I can upload to GitHub for further processing, https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github.

I had a look into documentation, at https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-format, and it appears I can only have one output format active at a time. Is this an actual limitation?

0

There are 0 answers