https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116613
--- Comment #20 from David Malcolm <dmalcolm at gcc dot gnu.org> --- Created attachment 59344 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59344&action=edit Generated HTML documentation (In reply to Kamil Dudka from comment #19) > Thank you for working on this! I really like the gcc-latest COPR, which > makes it easy to test the changes. I spotted that man pages installed by > gcc-latest are broken but that is a cosmetic issue. Sorry about that. For now, I'm attaching the relevant page of the generated HTML. -fdiagnostics-add-output=DIAGNOSTICS-OUTPUT-SPEC is near the bottom of that page. > I have hacked up a quick and dirty patch to make csmock-plugin-gcc use this, > tested it on the units and curl RPM packages and it seemed to work fine: > https://github.com/csutils/csmock/pull/187 Excellent; thanks! > > I needed to suppress the diagnostics output printed by gcc to stderr so that > csmock does not capture the same information twice using two different > formats. I was able to get around with `-fdiagnostics-format=json-file` but > it wastefully creates files that are not used for anything. > > Is there a better way to tell gcc to write all diagnostic messages only to > the specified SARIF file while keeping messages about unsupported flags, > non-existing input files and the like still printed to stderr? How about another option -fdiagnostics-set-output= that would work like -fdiagnostics-add-output= but rather than appending to the list of outputs, simply replaces anything in the existing list?