[cfe-dev] Assigning NULL

Steve Naroff snaroff at apple.com
Wed Nov 14 05:47:26 PST 2007


On Nov 13, 2007, at 10:29 PM, Chris Lattner wrote:

>
> On Nov 13, 2007, at 6:21 PM, Sanghyeon Seo wrote:
>
>> The following is a typical pattern in many C programs.
>>
>> #include <stddef.h>
>>
>> typedef void (*hookfunc)(void *arg);
>> hookfunc hook;
>>
>> void clear_hook() {
>> hook = NULL;
>> }
>>
>> Should this warn?
>> test.c:7:8: warning: incompatible pointer types assigning 'void *'
>> to 'hookfunc'
>
> This is definitely a bug.  Steve, I think
> Sema::CheckSingleAssignmentConstraints should handle this, what do you
> think?
>

Sounds right.

I can look at this later this week...right now, I'm focused on some  
other stuff (but you already know that:-)

snaroff

> -Chris
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list