https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120063

            Bug ID: 120063
           Summary: SARIF output: fatal errors should have their "level"
                    set to "error"
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ensadc at mailnesia dot com
  Target Milestone: ---

This is really a bug report against the `-fdiagnostics-format=sarif-stderr`
option, though the example is in C.

Compiling the following one-liner with `gcc -fdiagnostics-format=sarif-stderr
example.c`:

```
#include "nonexistent.h"
```

produces an output that ends with:

```
           "results": [{"ruleId": "fatal error",
                        "message": {"text": "nonexistent.h: No such file or
directory"},
                        "locations": [{"physicalLocation": {"artifactLocation":
{"uri": "<source>"},
                                                            "region":
{"startLine": 1,
                                                                      
"startColumn": 10,
                                                                      
"endColumn": 25},
                                                            "contextRegion":
{"startLine": 1,
                                                                             
"snippet": {"text": "#include \"nonexistent.h\"\n"}}}}]}]}]}
```

Note that, the result lacks a "level" property. This causes the level to
default to "warning", while a level of "error" should be more suitable.

Reply via email to