From: mstefani@redhat.com (Michael Stefaniuc)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Parsing error for struct names starting with two underscore
Date: Sat, 05 Jan 2013 23:48:43 +0100 [thread overview]
Message-ID: <50E8ADCB.9090407@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1301050906120.2085@localhost6.localdomain6>
Thanks Julia,
On 01/05/2013 09:07 AM, Julia Lawall wrote:
> The problem is that it was considering anything beginning with __ that
> is followed by an identifier to be an attribute. The following patch
> does not do that when the __ thing is immediately preceded by a struct.
> Perhaps that is not the best solution, but it works in this case.
the patch works here though only for structs and not unions. Which is
good enough for Wine. One of this days I should learn OCaml so I can
modify coccinelle myself...
bye
michael
> The line number in the patch are likely to be off.
>
> julia
>
> diff --git a/parsing_cocci/parse_cocci.ml b/parsing_cocci/parse_cocci.ml
> index f6ed199..13ce673 100644
> --- a/parsing_cocci/parse_cocci.ml
> +++ b/parsing_cocci/parse_cocci.ml
> @@ -828,6 +828,8 @@ let rec detect_attr l =
> let rec loop = function
> [] -> []
> | [x] -> [x]
> + | ((PC.Tstruct _,_) as t1)::x::rest ->
> + t1::x::loop rest
> | ((PC.TIdent(nm,clt),info) as t1)::id::rest when is_id id ->
> if String.length nm > 2 && String.sub nm 0 2 = "__"
> then (PC.Tattr(nm,clt),info)::(loop (id::rest))
next prev parent reply other threads:[~2013-01-05 22:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-04 21:53 [Cocci] Parsing error for struct names starting with two underscore Michael Stefaniuc
2013-01-05 8:07 ` Julia Lawall
2013-01-05 22:48 ` Michael Stefaniuc [this message]
2013-01-06 6:21 ` 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=50E8ADCB.9090407@redhat.com \
--to=mstefani@redhat.com \
--cc=cocci@systeme.lip6.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.