All of lore.kernel.org
 help / color / mirror / Atom feed
From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Source code analysis around "switch"
Date: Sat, 09 May 2015 10:10:34 +0200	[thread overview]
Message-ID: <554DC0FA.4010904@users.sourceforge.net> (raw)
In-Reply-To: <20150509074740.GB9628@opentech.at>

> @hascase@
> position p;
> @@
> switch at p (...)
> {
>  case...:...
> }
> 
> @hasdefault@
> @@
> switch (...)
> {
>  default:...
> }
> 
> @script: python depends on hascase && !hasdefault@
> p<<hascase.p;
> @@
> print "%s %s" % (p[0].file, p[0].line)
> 
> there likely is a simpler solution than this though.

I find such a SmPL approach incomplete.
Is the shown condition expression fragile and questionable?

Do you need to work more with position variables there
so that only really appropriate source code places
will be combined and then checked?

Regards,
Markus

  reply	other threads:[~2015-05-09  8:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07  2:32 [Cocci] Question about the use of "...when !=" in SmPL ZhouYuan
2015-05-09  7:47 ` Nicholas Mc Guire
2015-05-09  8:10   ` SF Markus Elfring [this message]
2015-05-09  8:28     ` [Cocci] Source code analysis around "switch" Nicholas Mc Guire
2015-05-09  8:40       ` SF Markus Elfring
2015-05-09  8:36   ` [Cocci] Question about the use of "...when !=" in SmPL Julia Lawall
2015-05-09 10:08     ` Nicholas Mc Guire
2015-05-09 14:09 ` Nicholas Mc Guire
2015-05-09 16:47   ` Julia Lawall
2015-05-10  7:29     ` [Cocci] Data provided by position variables SF Markus Elfring
2015-05-10  8:40       ` Julia Lawall
2015-05-10  8:47         ` SF Markus Elfring
2015-05-09 16:49   ` [Cocci] Question about the use of "...when !=" in SmPL Nicholas Mc Guire
2015-05-10  7:49     ` [Cocci] Improving small SmPL examples SF Markus Elfring
2015-05-10 12:58 ` [Cocci] Question about the use of "...when !=" in SmPL Julia Lawall
2015-05-10 16:28   ` [Cocci] Fine-tuning for switch statements SF Markus Elfring
2015-05-10 16:31     ` Julia Lawall
2015-05-10 16:34       ` SF Markus Elfring

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=554DC0FA.4010904@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=cocci@systeme.lip6.fr \
    /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.