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

Andrew Pinski pinskia@gmail.com
Sun May 17 20:54:00 GMT 2009


On Sun, May 17, 2009 at 1:52 PM, Manuel López-Ibáñez
<lopezibanez@gmail.com> wrote:
> 2009/5/17 Richard Guenther <richard.guenther@gmail.com>:
>>
>> Thus, I suggest to revert the patch or make the warning not part of -Wall.
>>
>
> It is part of Wextra, not Wall. If we don't really want to be warned about:
>
> if (!x && x)
>
> or
>
> if (x == 4 && x == 5)
>
> then the warning is not useful for GCC and it should be taken out of Wextra.
>
> But it is an useful warning and it found a bug in IRA.

Is there a way to tell if !x happens because of a macro, if there is
then we should not warn about it.  This is the current issue with this
warning (and most likely others too) is that they don't take into
account macros.

Thanks,
Andrew Pinski



More information about the Gcc-patches mailing list