lkml.org 
[lkml]   [2016]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser than zero
> +@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


\
 
 \ /
  Last update: 2016-01-05 15:41    [W:0.093 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site