[cfe-commits] r75650 - in /cfe/trunk: include/clang/AST/Type.h include/clang/Analysis/PathSensitive/SVals.h lib/AST/ASTContext.cpp lib/Analysis/CheckObjCInstMethSignature.cpp lib/CodeGen/CGExprScalar.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaExprCXX.cpp

steve naroff snaroff at apple.com
Tue Jul 14 12:20:09 PDT 2009


On Jul 14, 2009, at 3:07 PM, Fariborz Jahanian wrote:

>
> On Jul 14, 2009, at 11:53 AM, steve naroff wrote:
>
>>
>> On Jul 14, 2009, at 2:33 PM, Fariborz Jahanian wrote:
>>
>>> Maybe this was discussed before. Sorry for asking again. Why do we  
>>> exclude block pointers?
>>>
>>
>> No problem...we didn't discuss it at length. I think it would make  
>> sense, especially since Type::getPointeeType() allows block pointers.
>>
>> If I include block pointers, the following errors turn into  
>> warnings (which is fine with me...).
>>
>> /Users/snaroff/llvm/Debug/bin/clang-cc -fsyntax-only -verify /Users/ 
>> snaroff/llvm/tools/clang/test/Sema/block-misc.c -fblocks
>> Incorrect Output:
>> Errors expected but not seen:
>> Line 170: invalid operands
>> Line 174: invalid operands to binary expression
>> Line 176: invalid operands to binary expression
>> Line 178: invalid operands to binary expression
>> Line 179: invalid operands to binary expression
>> Line 180: invalid operands to binary expression
>> Line 181: invalid operands to binary expression
>> Warnings seen but not expected:
>> Line 170: ordered comparison between pointer and integer ('void (^) 
>> (int)' and 'int')
>> Line 174: comparison between pointer and integer ('void (^)(int)'  
>> and 'int')
>> Line 176: comparison between pointer and integer ('int' and 'void  
>> (^)(int)')
>> Line 178: ordered comparison between pointer and integer ('void (^) 
>> (int)' and 'int')
>> Line 179: ordered comparison between pointer and integer ('void (^) 
>> (int)' and 'int')
>> Line 180: ordered comparison between pointer and integer ('int' and  
>> 'void (^)(int)')
>> Line 181: ordered comparison between pointer and integer ('int' and  
>> 'void (^)(int)')
>>
>> What do you think?
>
> We should fix all these if these will be the side-effects. I don't  
> feel strongly about adding block pointer to your
> AnyPointer. But if AnyPointer includes function pointers then there  
> is a case asking for it.
>

It does include function pointers (since they are simply C pointers  
whose pointee is a function).

Sounds like it should be included. Chris, what's your take?

snaroff

> - Fariborz
>
>>
>




More information about the cfe-commits mailing list