This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]