[Cocci] Checking support for the analysis of preprocessor definitions

Julia Lawall julia.lawall at lip6.fr
Thu Aug 30 18:51:18 CEST 2018

On Thu, 30 Aug 2018, SF Markus Elfring wrote:

> >>  #define PADARG64 "0x%016"QUAD"x"
> How does the support for such preprocessor definitions look like by
> the Coccinelle software currently?
> https://github.com/coccinelle/coccinelle/issues/139
> I have tried another source code analysis experiment out.
> I got the following information then.
> elfring at Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci ~/Projekte/Coccinelle/Probe/find_macro_without_spaces_besides_identifier1.cocci
>> minus: parse error:

The only options before the : in such messages are minus and plus.  Minus
is the removed and context code as it should be matched against the
existing code. Plus is the added code or the context in which it occurs.

>>   around = 'Q',
>   whole content =  #define P64 "a"@literal_end Q at usage "@literal_startb"

I don't think that the semantic patch language supports concatenated
strings as patterns.


> I find this error message questionable because my test SmPL script does not
> contain a deletion specification (no “minus” there).
> Are these double quotation characters treated as tokens (for the attempted
> data processing with position metavariables)?
> http://coccinelle.lip6.fr/docs/main_grammar002.html
> Does such an example indicate challenges to see the end of the used variables
> (by the means of the semantic patch language)?
> Regards,
> Markus

More information about the Cocci mailing list