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"?


julia


-----------------------------------------------------------------------
maybe 10 most problematic tokens
-----------------------------------------------------------------------
-----------------------------------------------------------------------
NB total files = 1; perfect = 1; pbs = 0; timeout = 0; =========> 100%
nb good = 160,  nb passed = 2 =========> 1.23% passed
nb good = 160,  nb bad = 0 =========> 100.00% good or passed

Do you want to actually match NODE_END?  If so, it shouldn't be declared
as a metavariable.

Right, I do want to exactly match NODE_END, so I removed the declaration;
still no match though. If it is detected as a known macro it should be able to
be substituted, right?


julia


Thanks,
--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running
DRBD HA —  Disaster Recovery — Software defined Storage


--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running
DRBD HA —  Disaster Recovery — Software defined Storage
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to