On Wed, 23 Apr 2014, Johannes Berg wrote:
> On Wed, 2014-04-23 at 14:07 +0200, Julia Lawall wrote:
>
> > I think that the problem is that the SmPL parser doesn't really understand
> > about the ifdef. So it sees one expression right after another one, which
> > it is not happy about. It would be fine if there were semicolons after
> > the function call. If you can move up to the statement level in each
> > possible case, that might be a solution, but it might be too awkward in
> > practice. If the macro solution is feasible, that could be better. Fewer
> > changes to the source code as well.
>
> Yeah I was confused about all this as well - turns out that he's not
> trying to do function calls but rather function declarations:
>
> #if ...
> static int foo(void *a, int b, char c)
> #else
> static int foo(void *a, char c)
> #endif
> {
> ...
> }
>
> or such.
>
> I'm not sure how that would compile (it would require "b" being unused),
> but still.
I can think about it, but it is pretty far from the vision of Coccinelle,
which is that the combination of context code and + code should be a valid
syntactic unit, and on the side that we don't think much about ifdefs.
But I will think about it, because I can see that it is not a solvable
problem with the current technology.
thanks,
julia
--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html