On Tue, 28 Apr 2020, Paul Chaignon wrote:
> Hi all,
>
> I am working on a small semantic patch to annotate specific variables in
> our codebase with __attribute__((aligned(8))). The following program works
> fine.
>
> @r@
> expression e1, e2;
> identifier x;
> @@
> (
> struct \(icmphdr\|icmp6hdr\) x
> + __attribute__((aligned(8)))
> ;
> |
> struct \(icmphdr\|icmp6hdr\) x
> + __attribute__((aligned(8)))
> = ...;
> )
> ... when exists
> ctx_load_bytes(e1, e2, &x, ...)
>
> However, when I replace __attribute__((aligned(8))) with our internal
> macro __align_stack_8, it fails with the following error:
>
> plus: parse error:
> File "/home/paul/cilium/contrib/coccinelle/aligned.cocci", line 7, column
> 2, charpos = 77
> around = '__align_stack_8',
> whole content = + __align_stack_8
>
> I've tried adding '#define __align_stack_8' in a file passed with
> --macro-file, without success. Is this a known limitation for macros or
> am I missing something?
Try adding the "metavariable" declaration:
attribute name __align_stack_8;
julia
>
> Thanks,
> Paul
> _______________________________________________
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci