From: Kees Cook <keescook@chromium.org>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: cocci@inria.fr
Subject: Re: [cocci] metavariables in added attribute arguments
Date: Mon, 1 May 2023 13:54:02 -0700 [thread overview]
Message-ID: <645026ea.620a0220.f1a4f.8a79@mx.google.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2304291516550.2899@hadrien>
On Sat, Apr 29, 2023 at 03:17:40PM +0200, Julia Lawall wrote:
> > [...]
> > @annotate@
> > type COUNTER_TYPE, ARRAY_TYPE;
> > identifier allocated.STRUCT;
> > identifier allocated.ARRAY;
> > identifier allocated.COUNTER;
> > attribute name __counted_by;
> > @@
> >
> > struct STRUCT {
> > ...
> > COUNTER_TYPE COUNTER;
> > ...
> > ARRAY_TYPE ARRAY[]
> > + __counted_by(COUNTER)
> > ;
> > };
> >
> > This fails like so:
> >
> > $ cocci element_count.cocci net/packet/af_packet.c
> > plus: parse error:
> > File "element_count.cocci", line 33, column 15, charpos = 593
> > around = 'COUNTER',
> > whole content = + __counted_by(COUNTER)
> >
> > But I can produce (nonsense) output if I change the replacement to:
> >
> > ARRAY_TYPE ARRAY[
> > + COUNTER
> > ]
> > + __counted_by
> > ;
> >
> > Explicitly using "attribute name __counted_by;" didn't seem to help.
> > What am I missing?
>
> The problem is fixed. Actually, attributes in this position were just not
> supported at all. Thanks very much for the report.
Hurray! Thank you; the latest git works as I'd expect now. :) Now to get
my patch for the Linux kernel split up...
153 files changed, 157 insertions(+), 157 deletions(-)
--
Kees Cook
next prev parent reply other threads:[~2023-05-04 5:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-27 20:50 [cocci] metavariables in added attribute arguments Kees Cook
2023-04-28 8:18 ` Julia Lawall
2023-04-29 13:17 ` Julia Lawall
2023-05-01 20:54 ` Kees Cook [this message]
2023-05-01 21:27 ` Julia Lawall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=645026ea.620a0220.f1a4f.8a79@mx.google.com \
--to=keescook@chromium.org \
--cc=cocci@inria.fr \
--cc=julia.lawall@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.