On Sun, 29 Mar 2020, Christoph Böhmwalder wrote:
> Am 29.03.20 um 11:20 schrieb Julia Lawall>
> > It's not parsing anything. You can see that here. It is passing, ie
> > ignoring, the entire command line.
>
> Right, I misinterpreted that "passed" as "these parameters were passed
> to the macro:".
>
> >
> > I don't remember the exact situation with this code. Is there no
> > semicolon at the end of the macro line?
>
> This is the exact piece of code:
>
> RB_DECLARE_CALLBACKS_MAX(static, augment_callbacks, struct drbd_interval, rb,
> sector_t, end, NODE_END);
>
> Putting this (and only this) in a test.c file produces the same problem:
>
> $ spatch --parse-c test.c --debug --verbose-parsing
> init_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
>
> PARSING: test.c
> Warning: PARSING: type defaults to 'int'; value = [((((0, 2)))); (Tag1 ("",
> (("", 0, 0, 0, ""), -1)), (0), ((0, 0, 0, 0)), 0, (3))]
> ERROR-RECOV: end of file while in recovery mode
> parsing pass2: try again
> TYPEDEF:_handle_typedef=false. Not normal if don't come from exn
> Warning: PARSING: type defaults to 'int'; value = [((((0, 2)))); (Tag1 ("",
> (("", 0, 0, 0, ""), -1)), (0), ((0, 0, 0, 0)), 0, (3))]
> ERROR-RECOV: end of file while in recovery mode
> parsing pass3: try again
> (ONCE) CPP-MACRO: found known macro = RB_DECLARE_CALLBACKS_MAX
> TYPEDEF:_handle_typedef=false. Not normal if don't come from exn
> Warning: PARSING: type defaults to 'int'; value = [[[0]]; ((((0, 2)))); (Tag1
> ("", (("", 0, 0, 0, ""), -1)), (0), ((0, 0, 0, 0)), 0, (3))]
> passed:static , augment_callbacks , struct drbd_interval , rb ,
> passed:sector_t , end , NODE_END
> -----------------------------------------------------------------------
> maybe 10 most problematic tokens
> -----------------------------------------------------------------------
> -----------------------------------------------------------------------
> NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100%
> nb good = 1, nb passed = 2 =========> 66.67% passed
> nb good = 1, nb bad = 0 =========> 100.00% good or passed
>
>
> Does this mean that this is just "unparseable"?
Everything would be fine if the "static" were not there.
Maybe you could use sed to replace (static by (STATIC in your code base,
then run your script, and then use sed to go the other way...
I don't know if it could be possible to allow static in argument lists.
julia_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci