On Thu, 19 Aug 2010, Julia Lawall wrote:

> On Thu, 19 Aug 2010, Lucas De Marchi wrote:
> 
> > On Tue, Aug 10, 2010 at 3:55 PM, Julia Lawall <[email protected]> wrote:
> > > On Tue, 10 Aug 2010, Lucas De Marchi wrote:
> > >
> > >> Hi,
> > >>
> > >> I'd like to know how to deal with "already tagged token" errors. I've
> > >> tried several methods to accomplish the following, but either way,
> > >> sometimes I get this error.
> > >>
> > >> What I want to do is to fully parenthesize conditional expressions, so:
> > >>
> > >> "if (a && b && !c->test)" becomes "if ((a) && (b) && (!c->test))"
> > >
> > > && is a binary operator.  I have the impression that it associates as ((a
> > > && b) && c).  But it seems that you want only to put parentheses on things
> > > that don't have nested && operators?
> > >
> > > In ((a && b) && c) there are two parentheses on the a, and the outer one
> > > is considered to be tagging an already tagged token.  There is an operator
> > > ++ that is supposed to allow additions to accumulate, but it doesn't seem
> > > to work in this case.  It may be because the associated right parentheses
> > > are put in different places.
> > 
> > I still didn't get what the "already tagged token" means. Every now
> > and then I get this error.
> 
> It means that there are two matches to the code that want to update the 
> same token.
> 
> > Now what I am trying to do is to change expressions like "E == NULL"
> > to "!E", similar to what badzero.cocci does. I trimmed down my script
> > I my test file in order to help solving and this is what I got:
> > 
> > badnull.cocci
> > --------------------------
> > @fix disable is_zero,isnt_zero @
> 
> You probably want to disable is_null and isnt_null1, instead.

For me it's ok with this change.  It does nothing on the given C file.

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to