On Mon, 18 May 2020, Markus Elfring wrote:

> >>> If the developer forgets the \ there would likely be a parsing problem.
> >>
> >> I find it helpful to clarify parsing challenges around such an use case.
> >> It might occasionally be relevant if a line continuation indication
> >> was accidentally forgotten or was intentionally omitted.
> >>
> >> * Source code review should point such questionable places out, shouldn't 
> >> it?
> >>
> >> * How much does this implementation detail matter for the safe application
> >>   of the semantic patch language?
> >
> > This is not Coccinelle's problem.
>
> This software is also involved then.
>
>
> > A developer can run a compiler to check for parsing errors.
>
> I imagine that a missing line continuation can be hard to detect
> and report as a possible programming error because the corresponding
> code parts can still be valid on their own according to special circumstances.

If they are valid, then what is the problem.  Neither a compiler nor
Coccinelle can know what the developer intended.

> Can the semantic patch language help to insist for a search that a bit
> of source code belongs to the implementation of a function-like macro?

That's what the search that was written does.  The pattern that comes
after #define has to be in the definition of the macro.  Coccinelle never
matches things in more than one top-level term in the C file.

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

Reply via email to