2

I keep getting errors when I try to spatch out a field of a struct inside an instantiation:

@@
expression e; identifier i;
@@

 static struct genl_family i = {
 ...
- .id = e
 ...
 }

outputs:

init_defs_builtins: /usr/lib/coccinelle/standard.h
75 76
Fatal error: exception Failure("minus: parse error: \n = File \"4-15to5-4.cocci\", line 8, column 2,  charpos = 75\n    around = '.', whole content = - .id = e\n")

the code I'm trying to spatch:

static struct genl_family nl_ecnd_fam = {
    .id = GENL_ID_GENERATE,
    .name = ECNL_GENL_NAME,
    .hdrsize = 0,
    .version = 1,
    .maxattr = NL_ECNL_ATTR_MAX,
    .netnsok = true,
    .pre_doit = nl_ecnl_pre_doit,
    .post_doit = nl_ecnl_post_doit,
};

Any tips?

0 Answers0