On Sat, 2024-12-14 at 19:20 -0500, David Malcolm wrote: > With this patch, -fdiagnostics-format=sarif-stderr emits: > > "sourceLanguage": "cobol" > > for its artifacts, as per Appendix J of the SARIF spec. > > gcc/ChangeLog: > * cobol/cobol1.cc (cobol_get_sarif_source_language): New. > (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Set it to the above. > > Signed-off-by: David Malcolm <dmalc...@redhat.com> >
That said, I hacked up one of the examples to get a syntax error, and it looks like at least some (or all?) of the error-handling is going through yyerror and some similar functions in parse_ante.h, which bypasses gcc's diagnostic subsystem and instead uses fprintf. Hence none of this would make it into SARIF output. Are the functions in parse_ante.h the only places where you're doing errors and warnings, or are there any other internal APIs? I could take a look at porting them to gcc's diagnostic-core.h, I suppose. Dave