Re: [cocci] Can we match a known macro by macro name instead of expanded function name?
Julia Lawall <[email protected]>
| Newsgroups | fr.inria.cocci |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 29 Nov 2025, Markus Elfring wrote:
> > .cocci
> >
> > @r@
> > symbol SYSCALL_DEFINE1;
> > identifier fn;
> > type t;
>
> Is this metavariable unused in the SmPL code?
Yes. The declaration is not needed.
>
>
> > .c
> >
> > SYSCALL_DEFINE1(foo,int,x) { return 0; }
>
> How can a macro call be matched here?
We have already discussed extensively that it can't. Because the code
doesn't parse without doing the expansion.
julia
>
> > Using * was a bad idea. You can't transform macro expanded code.
>
> Would any more background information become relevant here?
>
> Regards,
> Markus
>