r269116 - Add -Wcast-calling-convention to warn when casting away calling conventions

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Tue May 10 17:55:49 PDT 2016


On Tue, May 10, 2016 at 2:00 PM, Reid Kleckner via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
> Author: rnk
> Date: Tue May 10 16:00:03 2016
> New Revision: 269116
>
> URL: http://llvm.org/viewvc/llvm-project?rev=269116&view=rev
> Log:
> Add -Wcast-calling-convention to warn when casting away calling conventions
>
> Summary:
> This only warns on casts of the address of a function defined in the
> current TU. In this case, the fix is likely to be local and the warning
> useful.
>
> Here are some things we could experiment with in the future:
> - Fire on declarations as well as definitions
> - Limit the warning to non-void function prototypes
> - Limit the warning to mismatches of caller and callee cleanup CCs
>
> This warning is currently off by default while we study its usefulness.

Turns out this wasn't true :-) For example, it's firing here:
https://build.chromium.org/p/chromium.fyi/builders/ClangToTWin%28dbg%29/builds/5569/steps/compile/logs/stdio

Adding DefaultIgnore in r269148.


More information about the cfe-commits mailing list