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: PATCH RFA: Change variable to bool


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
joseph@codesourcery.com


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