[cfe-commits] r162109 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaCast.cpp test/Sema/warn-bad-function-cast.c
jahanian
fjahanian at apple.com
Fri Aug 17 11:51:13 PDT 2012
On Aug 17, 2012, at 11:37 AM, Benjamin Kramer wrote:
>
> On 17.08.2012, at 19:22, Fariborz Jahanian <fjahanian at apple.com> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120817/0b4ef3c3/attachment.html>
More information about the cfe-commits
mailing list