Add a production for macro declaration end attributes. This parses the
following C code from Linux v5.6-rc7:
arch/x86/kernel/nmi_selftest.c:
static DECLARE_BITMAP(nmi_ipi_mask, NR_CPUS) __initdata;
Signed-off-by: Jaskaran Singh <[email protected]>
---
parsing_c/parser_c.mly | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/parsing_c/parser_c.mly b/parsing_c/parser_c.mly
index 684ee63e..d36ac2a6 100644
--- a/parsing_c/parser_c.mly
+++ b/parsing_c/parser_c.mly
@@ -1597,6 +1597,17 @@ decl2:
MacroDecl
((NoSto, fst $2, $4, true), [snd $2;$3;$5;$6;fakeInfo()]) }
+ | storage_const_opt TMacroDecl TOPar argument_list TCPar end_attributes
+ TPtVirg
+ { function _ ->
+ match $1 with
+ Some (sto,stoii) ->
+ MacroDecl
+ ((sto, fst $2, $4, true), (snd $2::$3::$5::$7::fakeInfo()::stoii))
+ | None ->
+ MacroDecl
+ ((NoSto, fst $2, $4, true), [snd $2;$3;$5;$7;fakeInfo()]) }
+
| storage_const_opt
TMacroDecl TOPar argument_list TCPar teq initialize TPtVirg
{ function _ ->
--
2.21.1
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci