<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63284>63284</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang with `-pedantic` issues `-Wgnu-line-marker` that it wrote itself in `-frewrite-includes` output
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
boris-kolpackov
</td>
</tr>
</table>
<pre>
Clang issues the `"this style of line directive is a GNU extension"` warning for line directives that it writes itself in the output produced with `-frewrite-includes`. For example:
```
$ cat <<EOF >test.c
#include <stdlib.h>
EOF
$ clang -pedantic -E -frewrite-includes -o test.i test.c
$ clang -pedantic -c test.i
test.i:1:5: warning: this style of line directive is a GNU extension [-Wgnu-line-marker]
# 1 "<built-in>"
^
test.c:4:5: warning: this style of line directive is a GNU extension [-Wgnu-line-marker]
# 1 "test.c"
^
test.c:1:5: warning: this style of line directive is a GNU extension [-Wgnu-line-marker]
# 1 "/usr/include/stdlib.h" 1 3 4
^
```
This appears to be new behavior starting from Clang 15.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VMuSqzYQ_Rqx6YISEugOCxa-tskus0kqawGNUUZGlNTYM3-fEsbOPJLF3UwVJQT9Ov06OgRzmhBrVv5k5SHRC43O163zJqQvzs66e3GXpHX9W723ejqBCWHBADQiMMWZEDSaAIHeLIIbwJoJoTceOzIXBBNAw2-__wn4SjgF4yYmBFMcrtpPZjrB4Pwnm-hbExiCqzeEAQwFtAOYaQ3qFpoXgtm7fumwh6uhMSJJB4-rQWqmzi49BqZ4Bo3zgK_6PFtkcsf4gfH7qfj23D5FAZ0mYHLP5P743ACTR8JAWXdXkJvnqBOot6bNRiaPN_HxufngPbpbC5bO2OuJTAfpEb6ihNTBGsbAx2j_Yd9tmjeV7S53OZO7ksndvajx-otdAVb-TP86TUsaVdOz9i_oWXl4pA45xM7JfbsYS6mZYuJC3OQAAKw8voPVMbkrvg3WFvIB5yuWbyyRaJbgmWi2BjPRPGZFCMhBQvEZ5udRXM8_Ijw9z6h9AHLQIkx4hRZHfTHOQyDtaV0h785wW868zJK-ln0lK51gnasnpYqK8yoZ6xKxUKrT2A6iap96xfMfvEDVy7ztuqJMTC24kFzlkldSFVWGVV5Vg-Y_Bi3l0Oas4HjWxmbWXs6Z86dkJYNaSfFUJFa3aMNKJEJEpKswVqQ8JL6ONmm7nAIruDWBwr9eyJDFjV4e63yf-kgWG-fE318aoPg7vnCE7-ji_1hh45Bk8bYeieYQmUE0TDQnQ-PSZp07M9FEfNsrnb37GzuKbV2xMNGsWf8TAAD__38dpQQ">