<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/120875>120875</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang (C23): Attributes with unknown "attribute-prefix" should not raise "-Wunknown-attributes"
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
namandixit
</td>
</tr>
</table>
<pre>
With `--std=c23`, when using attributes with an arbitrary `attribute-prefix`, Clang raises the warning `-Wunknown-attributes` as shown below.
```sh
$ cat test.c
[[cthrough::hello(bye((no)) go(away((please)))), cthrough::alvida(la la la la)]]
int main (void)
{
return 3;
}
$
$
$ clang --std=c23 test.c -o exe
test.c:1:3: warning: unknown attribute 'hello' ignored [-Wunknown-attributes]
1 | [[cthrough::hello(bye((no)) go(away((please)))), cthrough::alvida(la la la la)]]
| ^~~~~~~~~~~~~~~
test.c:1:50: warning: unknown attribute 'alvida' ignored [-Wunknown-attributes]
1 | [[cthrough::hello(bye((no)) go(away((please)))), cthrough::alvida(la la la la)]]
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
The whole point of `attribute-prefix`s is to be able to use attributes for multiple compilers without a `#ifdef`-hell. Thus, there is no reason for this warning to be raised. And if a warning has to be raised, it should be a different one (perhaps `-Wunknown-attribute-prefix`) such that it can selectively be disabled (since `-Wunknown-attributes` is useful in case of misspelled attributes in general).
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzcVc2OszYUfRpncxUEl_C3YMFkmif4pG9t8AW7dWxkm2Sy6bNXhmQmM_2m6q5SkZWAbY59zuUcc-_VZIhaVryw4nXHlyCtaw0_cyPUmwq73opb-1MFCaxM93sfBMtfB8xZmTI8wlWSgcUrMwEPwal-CeThGudzA9z1KjjubvHl9_H97GhUb3eEo-ZmAseVJw9BEly5MxEvrvdzMX8YezX7D3BWpsA9eGmvBnrS9pqwtIutTLfmZXzCAww8QCAfkiF2RIYvQ5DOLpNkecfyTpLWlmHd34hhzbA2lmHDsIEpdvMrv239sybuaRt7tCN8BuP6ogRnWGsOjxYnFq-xpZ0yAc5cGWBYX6wScSztWPWybr9xFBZnIGf52lG9biSef2FYtXqqwp0e7C3QG7G0u9PNu4zlXc7y7iFnvL2L-VEpYFjdNahATcY6EsCKl1_qvpIAAMiAVUf4z_WE9dq28tufn66vQhTpv1HiseD_Soqvury7ZDPNj2g4aTXBbOMHasdvrOpBeQgWegLea4q3i6dn04_WwXnRQc2aYLDnWWlyWxbYJQCH1fC5GgWN0dtRoQR-yMVHwkGSo7iGseCIe2tWwCCVf0-Ebfk1KkQCnRGgRuDvw5L7T1MirAoxKRYt1o2DUONIjiJRE2tez-Qkn_03YfOcVA34ZZAQJA8RdeAGPGkagrqQvkV4oXyURkRcr8xA_xRhykf9xkWDMjBwT1H6s_J-Jh0xnoRVBiYy5Lhm2CQ70eaiyRu-ozar8kNdZE2DO9mmQ0UFlkLwrCwFpk05lHWRlePID5nAaqdaTPGQIWJaZU2BSYnD0CP2dXOoyrwa2CGlM1c60fpyTqybdsr7hdoM07oqdpr3pP16VCCuUcQQ46nh2vjCvl8mzw6pVj74D4iggqZ2S3mG9RHz-OXmHXRfzouHJxni3wqA-CijsWErb5z3S3ERd4vTrQxh9tE-eGJ4mlSQS58M9szwFPd2_9vPzv5OQ2B4Wrl6hqc73UuLfwUAAP__uCRCWQ">