Re: cocci: multiple versions of function with different arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

johannes

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux