[C/C++/IRA] PR 16302 gcc fails to warn about some common logic errors

Manuel López-Ibáñez lopezibanez@gmail.com
Tue May 19 08:10:00 GMT 2009


2009/5/19 H.J. Lu <hjl.tools@gmail.com>:
> On Sun, May 17, 2009 at 1:21 PM, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> On Sat, May 16, 2009 at 5:17 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> 2009/5/16 Manuel López-Ibáñez <lopezibanez@gmail.com>:
>>>> That is strange, it should not warn for constants. Is it really 0 or
>>>> something else?
>>>
>>>
>>> I open a bug report with a testcase:
>>>
>>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40172
>>
>> Given all this and that bootstrap is still not fixed for some targets
>> I seriously
>> doubt this warning is worth all this trouble.
>>
>> Thus, I suggest to revert the patch or make the warning not part of -Wall.
>>
>
> How about this patch?

This just solves one instance of the problem. As long as we cannot
check for macro expansions, we will have the problem elsewhere. I am
ok with moving the warning out of Wextra. Much better than using
-Wno-logical-op, since this is likely to affect other programs, not
only GCC.

Mark, Joseph. Would a patch to move Wlogical-op out of Wextra be approved?

Cheers,

Manuel.



More information about the Gcc-patches mailing list