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
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to