<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61996>61996</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Compile error section type conflict
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
drhaozhong
</td>
</tr>
</table>
<pre>
The code is as follows:
`int cpu_ (void *attr) {}
const unsigned long _1 __attribute__((section("__"))) = (unsigned long)&cpu_ ;
const unsigned long _group __attribute__((section("__"))) = 0;`
GCC accepts the code, but clang rejects it:
ode0.c.cpp:1:24: warning: non-void function does not return a value [-Wreturn-type]
int cpu_ (void *attr) {}
^
GCC <4.6 also rejects this code. It is fixed in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31490
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU8mO2yAYfprfl1-xCHg9-JClrnqv1KOFMcZUBCyWSWeevrKTbnOoqkqWF8DfxgcPQSsrZQflGcprxlNcnO8mv3D3tjirstFNr93nRaJwk0QdkAecnTHuHoCdgFyB_LhXRNuIYk0DAm1enJ4Q6InH6IG2CPUZ6utjqXA2REx2J5_QOKtwOOIwbIv1mKIcBqAN0CZIEbWz-wfdBinQ9nEhsOtG9AfMPlU9NLDzX9iUd2n9H0ay4Vbkd-cfLxfkQsg1BozPqIBecEwRheFWoZdfpYgBdXwXmpskyUUu1hXY6QjsRAtgJ7xzb7VV26t19rBnOSe7K8PJyYDWRfQyJm-R4ws3SSKU58OXx9ghvq4SymfciIj_ujUI5Yf33oBdirxCboL76SQuOuxGc_wUt17M-pucUFtcYlz3btAeaK-EyJVNufMKaD8m9aaN4UD7sLj7MCaVC6WB9XoCdmXHoiXZ1LGpZS3PZHesGtKUZdvQbOkmXtaSjuNMxMiahrXHqhZzU4t6LiYh2kx3lFBGClKThlaU5vXcMjqPRX1s55aMEgoib1yb3JiX2yYp0yEk2VXHtq0yw0dpwn4UKLXyjvvkVoDymvlu--cwJhWgIEaHGH6hRB2N7C7utmojUXrvPD57hNtOoHB2NlrELHnTvQtIxyWNuXA3oP2G-HwcVu-2qIH2u44AtN91fg8AAP__GI0k7A">