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


Groups > linux.kernel > #1448671

Re: [PATCH RFC] coccinelle: tests: if and else branch should probably not be identical

From Julia Lawall <julia.lawall@lip6.fr>
Newsgroups linux.kernel
Subject Re: [PATCH RFC] coccinelle: tests: if and else branch should probably not be identical
Date 2016-07-22 19:00 +0200
Message-ID <rXLXQ-8gM-11@gated-at.bofh.it> (permalink)
References <rXECZ-3Mr-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> +virtual context
> +virtual org
> +virtual report
> +
> +@cond@
> +statement S1;
> +position p;
> +@@
> +
> +<+...
> +* if@p (...) S1 else S1
> +...+>

You don't need the <+... ...+>.  Just put the if by itself.

julia

> +
> +@script:python depends on org@
> +p << cond.p;
> +@@
> +
> +cocci.print_main("WARNING: possible condition with no effect (if == else)",p)
> +
> +@script:python depends on report@
> +p << cond.p;
> +@@
> +
> +coccilib.report.print_report(p[0],"WARNING: possible condition with no effect (if == else)")
> --
> 2.1.4
>
>

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


Thread

[PATCH RFC] coccinelle: tests: if and else branch should probably not be identical Nicholas Mc Guire <hofrat@osadl.org> - 2016-07-22 11:10 +0200
  Re: [PATCH RFC] coccinelle: tests: if and else branch should probably  not be identical Julia Lawall <julia.lawall@lip6.fr> - 2016-07-22 19:00 +0200
    Re: [PATCH RFC] coccinelle: tests: if and else branch should  probably not be identical Nicholas Mc Guire <der.herr@hofr.at> - 2016-07-22 21:20 +0200
      Re: [PATCH RFC] coccinelle: tests: if and else branch should probably  not be identical Julia Lawall <julia.lawall@lip6.fr> - 2016-07-23 12:50 +0200

csiph-web