Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1301559

Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser than zero

From Julia Lawall <julia.lawall@lip6.fr>
Newsgroups linux.kernel
Subject Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser than zero
Date 2016-01-05 15:20 +0100
Message-ID <qNACT-3VY-31@gated-at.bofh.it> (permalink)
References <qLpBT-7EZ-7@gated-at.bofh.it> <qN83U-op-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> +@script:python depends on org@
> +p << r_cmp.p;
> +e << r.e = "";
> +@@
> +
> +msg = "WARNING: Unsigned expression compared with zero: %s" % (e)
> +coccilib.org.print_todo(p[0], msg)
> +
> +@script:python depends on report@
> +p << r_cmp.p;
> +e << r.e = "";
> +@@
> +
> +msg = "WARNING: Unsigned expression compared with zero: %s" % (e)
> +if e:
> +    coccilib.report.print_report(p[0], msg)

Is it intentional that these don't do the same thing?  The report case has
an if on e, while the org case does not.  If you don't want a report when e
doesn't have a value, you could just remove the = "" from the declaration of
e.  That is to give a default value of e, to allow the rule to be executed
when e doesn't have a value.

julia
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v6] coccinelle: tests: unsigned value cannot be lesser than zero Andrzej Hajda <a.hajda@samsung.com> - 2016-01-04 08:50 +0100
  Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser  than zero "Geyslan G. Bem" <geyslan@gmail.com> - 2016-01-05 14:00 +0100
    Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser  than zero Julia Lawall <julia.lawall@lip6.fr> - 2016-01-05 14:10 +0100
      Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser  than zero "Geyslan G. Bem" <geyslan@gmail.com> - 2016-01-05 15:20 +0100
        Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser  than zero "Geyslan G. Bem" <geyslan@gmail.com> - 2016-01-05 17:50 +0100
    Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser than  zero Andrzej Hajda <a.hajda@samsung.com> - 2016-01-05 15:00 +0100
      Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser  than zero "Geyslan G. Bem" <geyslan@gmail.com> - 2016-01-05 15:20 +0100
  Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser  than zero Julia Lawall <julia.lawall@lip6.fr> - 2016-01-05 15:20 +0100
    Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser than  zero Andrzej Hajda <a.hajda@samsung.com> - 2016-01-05 15:30 +0100
    [PATCH v7] coccinelle: tests: unsigned value cannot be lesser than zero Andrzej Hajda <a.hajda@samsung.com> - 2016-01-07 10:40 +0100
      Re: [PATCH v7] coccinelle: tests: unsigned value cannot be lesser  than zero Julia Lawall <julia.lawall@lip6.fr> - 2016-01-07 12:40 +0100
        Re: [PATCH v7] coccinelle: tests: unsigned value cannot be lesser  than zero Michal Marek <mmarek@suse.com> - 2016-01-07 15:40 +0100

csiph-web