SARIF support in GCC

The Static Analysis Results Interchange Format (SARIF) is "an industry standard format for the output of static analysis tools" i.e. a machine-readable file format that can represent compiler diagnostics. (see also old SARIF website here, as the sarif.info link seems to have changed)

GCC's statement of use in the SARIF specification's issue tracker can be seen here

GCC as a SARIF producer

GCC 13 onwards can output its diagnostics in SARIF format.

GCC 15 onwards can output its diagnostics in multiple formats at once (such as text *and* SARIF).

User-facing documentation:

Implementation: gcc/diagnostic-format-sarif.cc

History of GCC as a SARIF producer

GCC 17 (in development)

GCC 16

GCC 15

GCC 14

GCC 13

GCC as a SARIF consumer

sarif-replay

As of GCC 15, GCC optionally provides a sarif-replay tool that accepts SARIF as input. This uses libgdiagnostics to "replay" any diagnostics within the .sarif files as if they were GCC diagnostics.

History of GCC as a SARIF consumer

GCC 17 (under development)

GCC 16

GCC 15

Bugs relating to GCC SARIF support

There is a "SARIF" keyword in GCC's bug tracker for bugs relating to GCC's SARIF support.

By keyword:

By text:

Bugs relating to sarif-replay:

None: SARIF (last edited 2026-11-02 15:14:27 by DavidMalcolm)