| 1 |
{"$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json", |
| 2 |
"version": "2.1.0", |
| 3 |
"runs": [{"tool": {"driver": {"name": "GNU C23", |
| 4 |
"fullName": "GNU C23 (GCC) version 15.0.1 20250203 (experimental) (x86_64-pc-linux-gnu)", |
| 5 |
"version": "15.0.1 20250203 (experimental)", |
| 6 |
"informationUri": "https://gcc.gnu.org/gcc-15/", |
| 7 |
"rules": []}}, |
| 8 |
"invocations": [{"executionSuccessful": false, |
| 9 |
"toolExecutionNotifications": []}], |
| 10 |
"originalUriBaseIds": {"PWD": {"uri": "file:///nonexistent/"}}, |
| 11 |
"artifacts": [{"location": {"uri": "too-many-arguments.c", |
| 12 |
"uriBaseId": "PWD"}, |
| 13 |
"sourceLanguage": "c", |
| 14 |
"contents": {"text": "extern void fn_a ();\n\nvoid test_known_fn (void)\n{\n fn_a (42);\n}\n"}, |
| 15 |
"roles": ["analysisTarget"]}], |
| 16 |
"results": [{"ruleId": "error", |
| 17 |
"level": "error", |
| 18 |
"message": {"text": "too many arguments to function 'fn_a'; expected 0, have 1"}, |
| 19 |
"locations": [{"physicalLocation": {"artifactLocation": {"uri": "too-many-arguments.c", |
| 20 |
"uriBaseId": "PWD"}, |
| 21 |
"region": {"startLine": 5, |
| 22 |
"startColumn": 3, |
| 23 |
"endColumn": 7}, |
| 24 |
"contextRegion": {"startLine": 5, |
| 25 |
"snippet": {"text": " fn_a (42);\n"}}}, |
| 26 |
"logicalLocations": [{"name": "test_known_fn", |
| 27 |
"fullyQualifiedName": "test_known_fn", |
| 28 |
"decoratedName": "test_known_fn", |
| 29 |
"kind": "function"}], |
| 30 |
"relationships": [{"target": 0, |
| 31 |
"kinds": ["relevant"]}]}], |
| 32 |
"relatedLocations": [{"physicalLocation": {"artifactLocation": {"uri": "too-many-arguments.c", |
| 33 |
"uriBaseId": "PWD"}, |
| 34 |
"region": {"startLine": 1, |
| 35 |
"startColumn": 13, |
| 36 |
"endColumn": 17}, |
| 37 |
"contextRegion": {"startLine": 1, |
| 38 |
"snippet": {"text": "extern void fn_a ();\n"}}}, |
| 39 |
"message": {"text": "declared here"}, |
| 40 |
"properties": {"nestingLevel": 0}}, |
| 41 |
{"physicalLocation": {"artifactLocation": {"uri": "too-many-arguments.c", |
| 42 |
"uriBaseId": "PWD"}, |
| 43 |
"region": {"startLine": 5, |
| 44 |
"startColumn": 9, |
| 45 |
"endColumn": 11}, |
| 46 |
"contextRegion": {"startLine": 5, |
| 47 |
"snippet": {"text": " fn_a (42);\n"}}}, |
| 48 |
"id": 0}]}]}]} |
| 49 |
|
| 50 |
/* Verify that we underline the "42" here. */ |
| 51 |
/* { dg-begin-multiline-output "" } |
| 52 |
In function 'test_known_fn': |
| 53 |
too-many-arguments.c:5:3: error: too many arguments to function 'fn_a'; expected 0, have 1 |
| 54 |
5 | fn_a (42); |
| 55 |
| ^~~~ ~~ |
| 56 |
too-many-arguments.c:1:13: note: declared here |
| 57 |
1 | extern void fn_a (); |
| 58 |
| ^~~~ |
| 59 |
{ dg-end-multiline-output "" } */ |