<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJylVE1vnDAQ_TXmMtoVayDAgUOSTarecqjUs41nWVfGprZJNvn1HUPSbjZVVKnIfIyfPfPeGwvp1HP37YhwcMa4J20H6J1CiF4PA_oAAu6FCQgPLuioH5EV1yzfs_zteZWvo19jbSOEn7PwyHiTAjuPjLfA6pt1AdCV5k_Aij3seMGKM2SdLfju3Wxa_7wgZXX1DvEYZ2_TNn4Nz78hVu8v6P2VM7zGvITeCJK-CVFRmb5tYfNdIU16EbWzG3GI6AkVEUckNpseRqHt9lX1k_CWrCNvYNSnZOLZZvLQqtVVHUhL78aJAGkQnnQ8AmW1SngVQOLBeYRbKs-qm08ZsGr_L_6ki1V3n5hxdxLjRFS0TTVviZs26OHuNBni4lMd3hxjnELqPL-nMTglnYlb5weKXuhuyy_i5UHaQK3enmdPJ-vVHBDTZDQGiO5MMvWNxip8_U7yGb8FOUf4CmKEOaTdyRTiGClhsvJdlUx1hWqLVmRijkfnu15448IgzCO-TNnsTXehgHyf5ZY6QYExj2-vzeTdD-wjhTqEGUnPfVWURZMdu0MpywLr6gqRFz0XcldW2DSibg9tU-9UZoREEzpykXEuZ_KGJx30Wg4XFT94ZyNa9RFRWgzWhaj7kMBqn_0_Zd3xnPN8x-u82RVVteVNz3sheU0ScqmQlTnSKTbblCd1M_PdkpLIBwKNDjH8AUUIerCIi0JiGHU0S7CKqPYXfwr47PxmC9luYfoLHBFdrg>53438</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] False Positive Wdeclaration-after-statement
</td>
</tr>
<tr>
<th>Labels</th>
<td>
bug,
clang:frontend,
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
carlosgalvezp
</td>
</tr>
</table>
<pre>
The following code triggers a False Positive:
```c
int square(int num) {
int x = 123;
x = 321;
int y = 456;
return x * y;
}
```
```
$ clang -std=c99 -Wdeclaration-after-statement -c main.c
warning: mixing declarations and code is incompatible with standards before C99 [-Wdeclaration-after-statement]
int y = 456;
^
```
Example in [Compiler Explorer](https://godbolt.org/z/94GazPbns).
The warning applies to standards **before** C99, but I am using C99 in the code.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNUsFu3CAQ_Rp8Ge3KhnXWPviQZJOqtxwq9Qxm7KXC4AJONvn6Duuk3aRVVAsbzzxg3nuD8vq5-3ZEGLy1_sm4EXqvEVIw44ghgoR7aSPCg48mmUdk4pqVB1a-fa_KdfRrbFyC-HORARlvcuCWifEW2P5mXQD05PwJmDhAxQUTF8iaFbx6l83rn8_Irr56hwRMS3B5G7-G598Q2x8-0PsnZ3iN-Q56K0n6JiZNZfq2hc13jZQMMhnvNnJIGAiVCSckNpseJmnc9lX1kwyOrCNvYDKnbOLFZvLQ6dVVE0lL76eZAGURnkw6Ap3qtAw6gsLBB4RbKs_qm08ZsPrwP_7kh9V3n5hxd5LTTFSMyzVviZuxGODuNFviEnId3hxTmmPuPL-nMXqtvE1bH0aKXuhtd1_ky4NykVq9vTw936xXc0DOszUYIfkLydQ3Gqvw9T_LZ_wW1JLgK8gJlph3Z1OIY6IDs5XvqhS6E7oVrSySSRY7EnLuJ5H_cHvhM0-LJdjug1Rq0KK21DIKrH18mzZz8D-wTxSaGBck4fe12ImmOHZS94Nqh0Errfa6FkPTDHVdNboS-1oNVWGlQhszS8a5WshEngXTtLIW10PwLqHTfyPayNH5mEwfM1gfCtPxkvOy4vuyqURdb3nT814qvr9CLJVGtiuRLqvdZuK5aUXozhqodCTQmpjiH1DGaEaHZxfz-XJJRx-6Xgbr4yjtI77MxVl0d1b8C0DBSSQ">