[PATCH] D17348: Add -Wcast-calling-convention to warn when casting away calling conventions

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 17 13:25:16 PST 2016


rnk created this revision.
rnk added reviewers: thakis, rtrieu.
rnk added a subscriber: cfe-commits.

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.

http://reviews.llvm.org/D17348

Files:
  include/clang/Basic/DiagnosticGroups.td
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/Sema/SemaCast.cpp
  test/Sema/callingconv-cast.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17348.48234.patch
Type: text/x-patch
Size: 5805 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160217/52a2ac67/attachment-0001.bin>


More information about the cfe-commits mailing list