| 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 |
"artifacts": [{"location": {"uri": "bad-binary-ops-highlight-colors.c"}, |
| 11 |
"sourceLanguage": "c", |
| 12 |
"contents": {"text": "/* Verify that colorization affects both text within diagnostic messages\n and underlined ranges of quoted source, and that the types we use\n match up between them.\n Also implicitly verify that -fdiagnostics-show-highlight-colors is\n on by default. */\n\n\n\nstruct s {};\nstruct t {};\ntypedef struct s S;\ntypedef struct t T;\n\nextern S callee_4a (void);\nextern T callee_4b (void);\n\nint test_4 (void)\n{\n return callee_4a () + callee_4b ();\n}\n"}, |
| 13 |
"roles": ["analysisTarget"]}], |
| 14 |
"results": [{"ruleId": "error", |
| 15 |
"level": "error", |
| 16 |
"message": {"text": "invalid operands to binary + (have ‘S’ {{aka ‘struct s’}} and ‘T’ {{aka ‘struct t’}})"}, |
| 17 |
"locations": [{"physicalLocation": {"artifactLocation": {"uri": "bad-binary-ops-highlight-colors.c", |
| 18 |
"uriBaseId": "PWD"}, |
| 19 |
"region": {"startLine": 19, |
| 20 |
"startColumn": 23, |
| 21 |
"endColumn": 24}, |
| 22 |
"contextRegion": {"startLine": 19, |
| 23 |
"snippet": {"text": " return callee_4a () + callee_4b ();\n"}}}, |
| 24 |
"logicalLocations": [{"name": "test_4", |
| 25 |
"fullyQualifiedName": "test_4", |
| 26 |
"decoratedName": "test_4", |
| 27 |
"kind": "function"}], |
| 28 |
"annotations": [{"startLine": 19, |
| 29 |
"startColumn": 10, |
| 30 |
"endColumn": 22, |
| 31 |
"message": {"text": "S {{aka struct s}}"}}, |
| 32 |
{"startLine": 19, |
| 33 |
"startColumn": 25, |
| 34 |
"endColumn": 37, |
| 35 |
"message": {"text": "T {{aka struct t}}"}}]}]}]}]} |
| 36 |
|
| 37 |
/* Verify that we underline and label the ranges for the |
| 38 |
"annotations" above. */ |
| 39 |
/* { dg-begin-multiline-output "" } |
| 40 |
bad-binary-ops-highlight-colors.c:19:23: error: invalid operands to binary + (have ‘S’ {aka ‘struct s’} and ‘T’ {aka ‘struct t’}) |
| 41 |
19 | return callee_4a () + callee_4b (); |
| 42 |
| ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ |
| 43 |
| | | |
| 44 |
| | T {aka struct t} |
| 45 |
| S {aka struct s} |
| 46 |
{ dg-end-multiline-output "" } */ |