On Tue, Aug 19, 2014 at 01:41:44PM -0400, Jason Merrill wrote:
> On 08/19/2014 12:52 PM, Marek Polacek wrote:
> >+ tree cst = TREE_CODE (op0) == INTEGER_CST
> >+ ? op0 : TREE_CODE (op1) == INTEGER_CST ? op1 : NULL_TREE;
>
> This indentation won't survive Emacs auto-indent; please add pare
On 08/19/2014 12:52 PM, Marek Polacek wrote:
+ tree cst = TREE_CODE (op0) == INTEGER_CST
+? op0 : TREE_CODE (op1) == INTEGER_CST ? op1 : NULL_TREE;
This indentation won't survive Emacs auto-indent; please add parentheses.
+ int sign = TREE_CODE (op0) == INTEGER_CST
+
On Mon, Aug 18, 2014 at 10:23:49PM +0200, Marek Polacek wrote:
> On Mon, Aug 18, 2014 at 04:10:49PM -0400, Jason Merrill wrote:
> > On 08/18/2014 04:04 PM, Marek Polacek wrote:
> > >Unfortunately, this warning cannot be enabled by -Wall yet, because
> > >of a few blunders we have in the codebase.
On Tue, Aug 19, 2014 at 11:08:39AM +0200, Manuel López-Ibáñez wrote:
> > Not sure about that: it matters whether the CST is a LHS or a RHS
> > - because we want to say if the comparison is always true or false.
> > I tried to introduce some bool flag, but that didn't really help
> > readability IMH
On 19 August 2014 06:58, Marek Polacek wrote:
> On Mon, Aug 18, 2014 at 10:57:58PM +0200, Manuel López-Ibáñez wrote:
>> On 18 August 2014 22:04, Marek Polacek wrote:
>> > +void
>> > +maybe_warn_bool_compare (location_t loc, enum tree_code code, tree op0,
>> > +tree op1)
>>
On Mon, Aug 18, 2014 at 10:57:58PM +0200, Manuel López-Ibáñez wrote:
> On 18 August 2014 22:04, Marek Polacek wrote:
> > +void
> > +maybe_warn_bool_compare (location_t loc, enum tree_code code, tree op0,
> > +tree op1)
> > +{
> > + if (TREE_CODE_CLASS (code) != tcc_compari
On 18 August 2014 22:04, Marek Polacek wrote:
> +void
> +maybe_warn_bool_compare (location_t loc, enum tree_code code, tree op0,
> +tree op1)
> +{
> + if (TREE_CODE_CLASS (code) != tcc_comparison)
> +return;
> +
> + /* CMP */
> + if (TREE_CODE (op1) == INTEGER_CST
On Mon, Aug 18, 2014 at 04:10:49PM -0400, Jason Merrill wrote:
> On 08/18/2014 04:04 PM, Marek Polacek wrote:
> >Unfortunately, this warning cannot be enabled by -Wall yet, because
> >of a few blunders we have in the codebase. But we really should iron out
> >that soon.
>
> Can you take care of t
On 08/18/2014 04:04 PM, Marek Polacek wrote:
Unfortunately, this warning cannot be enabled by -Wall yet, because
of a few blunders we have in the codebase. But we really should iron out
that soon.
Can you take care of that as well?
The patch looks good to me, but if it should be part of -Wall