<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/138973>138973</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang unknown warning option '-Walloc-size'
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jstengleingithub
</td>
</tr>
</table>
<pre>
Gcc support warning flag -Walloc-size: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Warn about calls to allocation functions decorated with attribute alloc_size that specify insufficient size for the target type of the pointer the result is assigned to, including those to the built-in forms of the functions aligned_alloc, alloca, calloc, malloc, and realloc.
Clang doesn't support this flag or catch the same issues gcc can catch with the flag. See: https://godbolt.org/z/roMdhxce4
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsU0FvnDwQ_TXmMlrEGljYA4f98omeqh56yDEy9gBOjY3scdLk11c220StegJmHm-e3zyLEPRiEQfW_sfa_wsRaXV-eA6EdjGo7aJpjVMxOfU2fJESQtx35wlehbfaLjAbscDpURjj5Cnod2T1DVaiPbD6xvjI-LhIWS42ls4vjI_OGm1RORmOFuPj48F1-raTdjaUK22GVbdUBjG5SCCFMQHIQZ4jEgzmaGXGg0LpvCBU8KppBUHk9RQJD_RTUgW0CoKwo9TzG2gb4jxrqdES5PbsPNCKQMIvSEBvO4Kbc2l32hIebY8hGgId4G6cAnKMP4C20kSVDKHVBUxSE36K2tBJ28S_hd-Mn8qFySRPWWjiOc6X3uRHbfvsWgUe82fJqhurbg9G2AWUw2AZ7-hjPbTqcOzGeZCC5JonB7Eh6BAiBlikBCnsvZudy-KMWEqA7_ivTTo1OUP3Tb4zPnr3Va0_JTaFGmp1ra-iwOHcNZdLW7fXtlgHeWk61ffq2teTqnvJL1VbzUJ1lwbFJJtCD7zibdVWHT_X9bktq8u1k1PXVRMXc1_1rKlwE9qUxrxsaXaRTzCc6_7a1YURE5qQA8y5TH4wzlOW_ZB-OE1xCaypjA4UPilIk8EhwyHaH9a92o9Mu5xDYLz7I9i8K6I3w1-W5PtRSrcxPib2--O0e_eMkhgfD78ZH--CXwb-KwAA__9Fby7O">