https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116978
--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> --- Note that if you're invoking cc1 or another compiler directly, rather than via the "gcc" or "xgcc" driver, add -dumpbase foo or similar before -fdiagnostics-format=sarif-file, so that it will write to foo.sarif: $ ./cc1 -dumpbase foo -fdiagnostics-format=sarif-file /dev/null -dumpbase $ ll foo.sarif -rw-rw-r--. 1 david david 2110 Oct 4 18:43 foo.sarif otherwise you'll get: $ ./cc1 -fdiagnostics-format=sarif-file /dev/null cc1: error: unable to determine filename for SARIF output