This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR c++/33160: wrong "NULL used in arithmetic" warning
Manuel López-Ibáñez wrote:
> On 12/11/2007, Mark Mitchell <mark@codesourcery.com> wrote:
>> if ((orig_op0 == null_node || orig_op1 == null_node)
>>
>> should be false.
>>
>> The bug might be that something is thinking that (intptr_t)__null is a
>> no-op cast and is throwing away the cast -- even though it is important,
>> for exactly the reason shown here. It would be OK to replace the cast
>> with a zero of the correct type (rather than leaving the cast itself
>> explicit).
>>
> That is exactly what I was thinking. Any hints where this may be happening?
No, sorry, I have no idea; you'll just have to step through the code
that handles casts...
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713