Re: [PATCH 3/3] evaluate: warn on identical exprs on ?:

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux