On Aug 17, 2012, at 11:37 AM, Benjamin Kramer wrote: > > On 17.08.2012, at 19:22, Fariborz Jahanian <[email protected]> wrote: > >> Author: fjahanian >> Date: Fri Aug 17 12:22:34 2012 >> New Revision: 162109 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=162109&view=rev >> Log: >> c: implement gcc's -Wbad-function-cast which warns >> on unsafe cast of a c-function call. This is >> a C-only option. >> >> Added: >> cfe/trunk/test/Sema/warn-bad-function-cast.c >> Modified: >> cfe/trunk/include/clang/Basic/DiagnosticGroups.td >> cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td >> cfe/trunk/lib/Sema/SemaCast.cpp >> >> Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td >> URL: >> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=162109&r1=162108&r2=162109&view=diff >> ============================================================================== >> --- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original) >> +++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Fri Aug 17 12:22:34 >> 2012 >> @@ -157,6 +157,7 @@ >> def OverloadedVirtual : DiagGroup<"overloaded-virtual">; >> def PrivateExtern : DiagGroup<"private-extern">; >> def SelTypeCast : DiagGroup<"cast-of-sel-type">; >> +def BadFunctionCast : DiagGroup<"bad-function-cast">; >> def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">; >> def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">; >> def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">; >> @@ -377,7 +378,8 @@ >> ObjCMissingSuperCalls, >> OverloadedVirtual, >> PrivateExtern, >> - SelTypeCast >> + SelTypeCast, >> + BadFunctionCast >> ]>; > > While warning compatibility with gcc is a good thing, I don't think having it > on with -Wall is a good idea. GCC doesn't seem to enable it with -Wall either. Sure enough. In r162117. - fariborz
> > - Ben >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
