On Thu, 20 May 2010, Arnaud Lacombe wrote:

> Hi,
> 
> On Thu, May 20, 2010 at 4:36 PM, Julia Lawall <[email protected]> wrote:
> > You don't have an example that provokes the TODO?
> >
> I do:
> 
> void
> g(pps)
>  register struct s **pps;
> {
>         struct r *pr;
> 
>         pr = (struct r *)*pps + h(pps);
> }
> 
> produces:
> 
> init_defs_builtins: /data/opt/coccinelle/share/coccinelle/standard.h
> 
> PARSING: route.c
> (ONCE) CPP-TYPEDEF: promoting: pps
> SEMANTIC:parameter name omitted, but I continue
> TYPEDEF CONFLICT:pps
> TODO:typedef now used as an identifier
> 
> > As long as there is no code you care about in f0
> >
> This is the point, there was code I cared about, but it can be
> trivially to fixed by hand :)

I don't think I am going to be very successful with fixing this.  The 
problem is that a function prototype initially looks like a K&R function 
definition, eg

int f(foo,bar,xyz)

If it is a prototype, then foo, bar, and xyz are typedefs (presumably 
defined in some header file we don't have access too).  If it is a K&R 
definition, then they are variables.

Unfortunately, trying to make the parser aware of which it is seems to 
introduce conflicts.

Since K&R C is not very well supported anyway, due to the need for the 
declarations not to appear in the leftmost column, and due to the general 
complexity of the parser, I think the risk of breaking something is higher 
than the benefit of fixing the problem.

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

Reply via email to