<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/83813>83813</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang reports [-Wmissing-noreturn] warning only for functions with void return type.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mushenoy
</td>
</tr>
</table>
<pre>
Clang reports ```-Wmissing-noreturn``` warning only for functions with void return type.
It doesnt seem to report the warning for functions with non-void return type.
GCC reports the warnings for both type of functions.
Sample program:
void_prog.c:
```
#include <stdlib.h>
void test ()
{
abort(); ;
return;
}
```
int_prog.c:
```
#include <stdlib.h>
int test ()
{
abort(); ;
return 0;
}
```
Compilation with Clang:
```
# clang -c -Wmissing-noreturn void_prog.c
void_prog.c:4:1: warning: function 'test' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
{
^
1 warning generated.
# clang -c -Wmissing-noreturn int_prog.c
#
```
Compilation with GCC:
```
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVMGO2yAQ_Rp8GSXCYCf2wYdN0qx67qHHCuOJTYUhgvGu8veVHSeb3c22XbWShWEGHm_eDKNiNK1DrFi-YfkuUQN1PlT9EDt0_pTUvjlVW6tcCwGPPlAEtuLnb_G9NzEa1y6cD0hDcFcXPKvgjGvBO3uCgw9wGJwm412EZ0MdPHnTwPkQ0OmIS2B8x_jDV4LGY3QEEbEH8vO1QB1eQe_gOe8W7zDPkOfxcbu9RnCDFSew2lM3HQF_eEF-df6b6o8W4Rh8G1TP5Gwe7_wxGpf6aruqMC-FNE7boUFgchupsaZedkx-uYWfuBNGAiYKJsrZt96cJwAAqvaBZq_cAJM3vln-i4mtd_epTKNx9D8oG0f_zBj4X3Le-v5orBrzck74VJO_4Q96KtqFhvdlCrdZu5PGjMmHlMmHS5GM00tVABPrMWom1qD9YBuoERrUVgVsztQUUTD1QDjuvT4NsQaWb-68mXz3RjqWzzqn14pv0WFQhM2rmvxTmDeJvuz_jMSP2-2HAl-WSVPJppSlSrBK17zMs1W-lklXFeUhLQpMS1VkhZQ8PWC5ystS1Pqgm7xJTCW4yLjkWcq5yMWSSynSPON6pTOuM84yjr0ydmntU7_0oU1MjANWhSxSmVhVo41T2xJiEoEJMXawUI37F_XQRpZxayLFFwQyZPFtP_sgK5_vYckQbNURHeOom9gzsW8NdUO91L5nYj_SmH-LY_A_URMT-ymqyMR-CuxXAAAA__-wLqvf">