On Mon, 18 May 2020, Markus Elfring wrote:

> >>> @@
> >>> identifier mac,f;
> >>> @@
> >>>
> >>> *#define mac(...) <+... f(...) ...+>
> >>
> >> Does such an analysis approach restrict the source code search really on
> >> complete definitions for function-like macros?
> >
> > Coccinelle knows where the macro ends.
>
> This is good to know.
>
>
> > A macro has to be on one line,
>
> This fact is reasonable.
>
>
> > perhaps extended with a \
>
> How would (or should) the Coccinelle software handle the mentioned search 
> pattern
> if such a line continuation indication was omitted between a macro declaration
> and subsequent source code?

The macro ends at the first line that doesn't end with a \

If the developer forgets the \ there would likely be a parsing problem.

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

Reply via email to