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++ PATCH to implement -Wbool-operation (PR c/77490)


On Fri, 23 Sep 2016, Marek Polacek wrote:

> On Thu, Sep 22, 2016 at 05:24:31PM +0000, Joseph Myers wrote:
> > On Wed, 21 Sep 2016, Marek Polacek wrote:
> > 
> > > > > > And let's refer to "expression of type bool" rather than "boolean
> > > > > > expression".
> > > > > 
> > > > > Adjusted (and in the C FE too).
> > > > 
> > > > Hmm, I'm not sure that change is right for C.  But the C++ hunk is OK.
> > > 
> > > Thanks.  Joseph, how about the C part?
> > 
> > You shouldn't refer to "type bool" for C.  If it's the result of a boolean 
> > operation, the type is int; an expression has type _Bool only if cast to 
> > that type or if it's a variable of that type.
> 
> Ok, so how about this one?

The C changes here are OK.

-- 
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]