When using GCC/G++ to compile, passing -fdiagnostics-color=always as well as -fdiagnostics-add-output=sarif means that GCC 16.1.1 produces ANSI escape characters in it's message output, e.g.:
"message": {"text": "by argument 2 of type ‘^[[01m^[[Kconst uint8_t*^[[m^[[K’ {{aka ‘^[[01m^[[Kconst unsigned char*^[[m^[[K’}} to ‘a::b::c::D::Dconst uint8_t*)’ declared here"},
While technically speaking this does not comply with JSON standards/encoding, adding strict=False to the json.load() call in load_sarif_file() makes it possible to ingest such a file.
When using GCC/G++ to compile, passing
-fdiagnostics-color=alwaysas well as-fdiagnostics-add-output=sarifmeans that GCC 16.1.1 produces ANSI escape characters in it's message output, e.g.:While technically speaking this does not comply with JSON standards/encoding, adding
strict=Falseto thejson.load()call inload_sarif_file()makes it possible to ingest such a file.