All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Forbes <chrisf@ijw.co.nz>
To: Josh Triplett <josh@joshtriplett.org>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH 3/3] evaluate: warn on identical exprs on ?:
Date: Sun, 28 Aug 2011 14:51:10 +1200	[thread overview]
Message-ID: <CAH3ygc0h9KD6gPRj-72s1M199Di+YqkSjwqazSaQVgvp+LLQtA@mail.gmail.com> (raw)
In-Reply-To: <20110828024618.GA20823@leaf>

Thanks Josh -- that is a bit messy, the change to that guard does need
pushed down into the first patch. I'll fix that, any other things to
change before I resubmit?

-- Chris

On Sun, Aug 28, 2011 at 2:46 PM, Josh Triplett <josh@joshtriplett.org> wrote:
> On Sun, Aug 28, 2011 at 10:26:55AM +1200, Chris Forbes wrote:
>> Adds a warning when identical expressions are found on both the true and false branches of ?:. This is another common copy-paste error.
>>
>> Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
>> ---
>>  evaluate.c                                 |    8 +++++++-
>>  validation/check_identical_exprs_on_cond.c |   13 +++++++++++++
>>  2 files changed, 20 insertions(+), 1 deletions(-)
>>  create mode 100644 validation/check_identical_exprs_on_cond.c
>>
>> diff --git a/evaluate.c b/evaluate.c
>> index 11de7aa..c339e63 100644
>> --- a/evaluate.c
>> +++ b/evaluate.c
>> @@ -898,7 +898,7 @@ static int expr_list_equiv(struct expression_list *lhs,
>>  int expr_equiv(struct expression *lhs, struct expression *rhs)
>>  {
>>       /* recursively determine if lhs ~ rhs. */
>> -     if (!lhs ^ !rhs) return 0;
>> +     if (!lhs || !rhs) return 0;
>
> You introduced this earlier in the same patch series.  This looks like
> it needs some patch cleanup.
>
> - Josh Triplett
>
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-08-28  2:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-27 22:26 [PATCH 1/3] evaluate: warn on identical exprs around '&&' Chris Forbes
2011-08-27 22:26 ` [PATCH 2/3] evaluate: warn on identical exprs around '||' Chris Forbes
2011-08-27 22:26 ` [PATCH 3/3] evaluate: warn on identical exprs on ?: Chris Forbes
2011-08-28  2:46   ` Josh Triplett
2011-08-28  2:51     ` Chris Forbes [this message]
2011-08-28  2:50 ` [PATCH 1/3] evaluate: warn on identical exprs around '&&' Josh Triplett
2011-08-28  2:53   ` Chris Forbes
2011-08-28  3:33     ` Josh Triplett
2011-08-28  2:57   ` Chris Forbes
2011-08-28  3:36     ` Josh Triplett
2011-08-31  0:24 ` Christopher Li
2011-08-28  3:14 Chris Forbes
2011-08-28  3:14 ` [PATCH 3/3] evaluate: warn on identical exprs on ?: Chris Forbes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH3ygc0h9KD6gPRj-72s1M199Di+YqkSjwqazSaQVgvp+LLQtA@mail.gmail.com \
    --to=chrisf@ijw.co.nz \
    --cc=josh@joshtriplett.org \
    --cc=linux-sparse@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.