This is the mail archive of the
mailing list for the GCC project.
Re: PATCH RFA: Change variable to bool
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 16 Jun 2009 20:08:09 +0000 (UTC)
- Subject: Re: PATCH RFA: Change variable to bool
- References: <firstname.lastname@example.org>
On Tue, 16 Jun 2009, Ian Lance Taylor wrote:
> In the function grokdeclarator in c-decl.c the local variable
> size_varies has type int, but is effectively treated as a bool. In
> particular, it is used in statements like
> this_size_varies = size_varies = 1;
> where this_size_varies has type bool. This is OK in C but the C++
> frontend gives a warning about an assignment used as a truth value
> without parentheses. This patch avoids the issue by changing the type
> of size_varies, which seems like the right thing to do anyhow.
> Bootstrapped and tested on x86_64-unknown-linux-gnu. This patch
> requires the approval of a C frontend maintainer or a global
> maintainer. OK for mainline?
This is OK, but the difference in warnings should be filed as a PR
(probably C should warn here).
Joseph S. Myers