This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix compiler warnings
- From: Marek Polacek <polacek at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Aditya K <hiraditya at msn dot com>, Richard Sandiford <rdsandiford at googlemail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 6 May 2015 18:18:23 +0200
- Subject: Re: Fix compiler warnings
- Authentication-results: sourceware.org; auth=none
- References: <BLU179-W78C3F88CD6DA1340CE7255B6D00 at phx dot gbl> <20150506145803 dot GY1751 at tucnak dot redhat dot com>
On Wed, May 06, 2015 at 04:58:03PM +0200, Jakub Jelinek wrote:
> Also, it would be nice to figure why gcc doesn't warn (for both meaningful
> changes, in the first snippet I believe gcc just determines the static
> function is noreturn and that is why it correctly doesn't warn).
> I thought Marek has added patches for the !x == Y case recently, so it would
> be nice to find out why we don't warn in that case.
Yes, I'd expect a warning to trigger on that.
> Similarly for the bool case, does clang warn on +/++ operation on bool (which
> is well defined, supposedly it should be some style warning?), or something
> else?
clang++ warns for
bool b = false;
b++;
but not for
bool b = false;
b += 2;
Marek