On Oct 30, 2008, at 7:56 PM, Zhongxing Xu wrote:

> Hi Ted,
>
> Would visiting the InitList from right to left lead to some bugs?  
> For example:
>
> int x = 3;
> int a[3] = {1, x = 1, 2*x+3};
>
> At last a should be { 1, 1, 5 }. But visit from right to left  
> results { 1, 1, 9 }

I don't think the order of evaluation is defined (we should consult  
the standard).  If there is an explicit control-flow dependency  
between the subexpressions, we should put that explicitly in the CFG.   
In that case visiting the subexpressions from right-to-left or left-to- 
right won't matter (as the expressions will have already been  
evaluated).
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to