<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/127813>127813</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang SARIF output doesn't seem to capture fix-it hints
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
davidmalcolm
</td>
</tr>
</table>
<pre>
I tried this example on Compiler Explorer:
https://godbolt.org/z/Gz1GePzK7
```
#include <stdlib.h>
void foo (void *p)
{
free (p)
}
```
with x86-64 clang (19.1.0 and trunk), and ``-fdiagnostics-format=sarif``.
The textual output is:
```
<source>:5:13: error: expected ';' after expression
5 | free (p)
| ^
| ;
1 error generated.
```
showing an "insert a semicolon" fix-it hint, whereas the SARIF output is:
```
{"$schema":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/cos02/schemas/sarif-schema-2.1.0.json","runs":[{"artifacts":[{"length":57,"location":{"index":0,"uri":"file://<source>"},"mimeType":"text/plain","roles":["resultFile"]}],"columnKind":"unicodeCodePoints","results":[{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"index":0,"uri":"file://<source>"},"region":{"endColumn":13,"startColumn":13,"startLine":5}}}],"message":{"text":"expected ';' after expression"},"ruleId":"1537","ruleIndex":0}],"tool":{"driver":{"fullName":"","informationUri":"https://clang.llvm.org/docs/UsersManual.html","language":"en-US","name":"clang","rules":[{"defaultConfiguration":{"enabled":true,"level":"error","rank":50},"fullDescription":{"text":""},"id":"1537","name":""}],"version":"21.0.0git"}}}],"version":"2.1.0"}
```
(all on one line)
which doesn't seem to capture the fix-it hint.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVs2OozgQfhrnYgWBCQ0cOKSTyag1s6vRzswDOHYBnjU28k8m3U-_MqYTku5e7WFRJIzrx1Vffa4KtVZ0CqBBxSMq9ivqXa9Nw-lJ8IFKpuWwOmr-3DxhZwRw7Hph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