<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/74605>74605</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Make -Wincompatible-pointer-types an error by default
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          thesamesam
      </td>
    </tr>
</table>

<pre>
    GCC 14 plans to make `-Wincompatible-pointer-types` an error by default for >= C99. GCC may still roll back this specific change (while retaining the other modern C changes) for GCC 14 and reinstate that one change again later depending on how we get on with the porting work. My hope is that we won't need to do that, but I mention it for full disclosure.

Clang has a subset warning, `-Wincompatible-function-pointer-types`, which was made fatal in Clang 16. GCC hasn't implemented this subset warning, but after discussion (some at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109835, some off-bug), decided this probably wasn't worth it, and to go wholehog with `-Wincompatible-pointer-types` as an error instead.

fweimer and I have already been doing the various autoconf configure comparisons and so on. so far, the damage isn't really bad at all for the configure check side, although the blast radius in general for C is still fairly big (but manageable) for the warning overall.

I think it makes sense for Clang to make `-Wincompatible-pointer-types` an error as well, given that it's _very_ often an indicator of wrong code. So far, many of the examples I've seen were either always outright broken, or at least broken on 32-bit.

cc @AaronBallman
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVc2O4zYTfBr60hhDpsZ_Bx92PZ8_zGFPOeS4aJEtkhmKLZCUFefpg5ZmstlsEAQ5SAJEsrq6qkhiKcEloovaf1b7lw1O1XO-VE8FB3k2HdvH5f_XK-yeYYyYClSGAd8I1KF5-jkkw8OINXSRnkYOqVJ-qo-Rijo0gAkoZ87QPcBSj1Os0HMG1f5PtS9wPZ-3INgDPqDUECNkjhE6NG9QfShQRjKhDwaMx-QIlD7NPkSCTBVDCslB9QRcPWUY2FJOcH2fXJQ-L9Xe2WOykCmkUrESVI8VONEHM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