cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: cocci@systeme.lip6.fr
Subject: Re: [Cocci] struct replacement
Date: Sat, 15 Dec 2018 14:49:13 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1812151447110.2428@hadrien> (raw)
In-Reply-To: <c8041b90-d4e9-a9a6-603d-7f5498fe081c@users.sourceforge.net>



On Sat, 15 Dec 2018, SF Markus Elfring wrote:

> > If you want to make a function prototype, it needs a type in front of it.
>
> This information is appropriate according to the syntax of the C programming language.
>
>
> > This can be a type metavariable, declared with type t;
>
> Can this detail be treated as optional by the means of the semantic patch language
> (without using extra SmPL disjunctions)?

No, it is not optinal in the case of a function prototype.  It is optional
in the case of a function definition.  A prototype without a specified
return type looks too much like a function call, and causes parsing
issues.

>
>
> > But actually your rule should be:
>
> @replacement@
> @@
>  struct
> - old_thing
> + new_thing
>
> Such a succinct change specification seems to be nice.
> Will further collateral evolution matter for this transformation approach?
>
> * Will any related adjustments be needed for data type definitions?
>   https://en.cppreference.com/w/c/language/typedef
>
> * Should source code be updated also in header files then?

To include header files, ie to cause them to be treated as independent
files, like .c files, give the command line argument --include-headers.

julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

  parent reply	other threads:[~2018-12-15 13:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 18:39 [Cocci] struct replacement Max
2018-12-13  6:24 ` Julia Lawall
2018-12-13 16:43   ` Max
2018-12-13 20:01     ` Julia Lawall
     [not found]       ` <c8041b90-d4e9-a9a6-603d-7f5498fe081c@users.sourceforge.net>
2018-12-15 13:49         ` Julia Lawall [this message]
2018-12-18 16:15       ` Max
2018-12-18 16:19         ` Julia Lawall
2018-12-18 16:44           ` Max
2018-12-18 16:54             ` Julia Lawall
2018-12-18 17:12               ` Max
2018-12-18 17:18                 ` Julia Lawall
2018-12-18 18:13                   ` Max

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=alpine.DEB.2.21.1812151447110.2428@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=elfring@users.sourceforge.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).