Il giorno 25/ott/2011, alle ore 13:31, Abramo Bagnara ha scritto:

> 
> No, it is not useless because it is the reason why the decay has happened.
> 
> The agreed intention is to move toward a direction where we mark as NoOp
> only casts that has no effects (i.e. that can be removed without
> influencing neither parsing nor execution).
> 
> A cast whose presence is the reason why the array decay to pointer is
> done is not a redundant cast.
> 
> Of course the context should not be taken in consideration i.e. the
> expression should be considered in isolation.
> 
> int a[4];
> int *p;
> p = (int*)a;
> sizeof((int*)a);
> 
> Both array to pointer cast are relevant despite the fact that only in
> one case the context would have generated it nevertheless.
> 
> Do you think is a sensible approach?

I'm not sure, but I agree that this way the AST would be more consistent.
I'll try to see how to change this detail.

In the meantime, Doug what do you think?

Bye,
Nicola
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to