Hi Jordan!

> Even though this actually does something ("++x == ++x"), it's not 
> well-defined anyway (specifically, either one could go first), so I'd still 
> like to catch this as a copy-paste error. What do you think?

Yes this is true now as we are only checking comparison operators. However:

1. When we extend it to && and || operators we must be more careful about this. 
We can of course add logic later that avoids increment only if the top operator 
is && or ||.

2. I think it would be interesting to add new diagnostics about undefined 
execution order. Then we will warn about ("++x == ++x") with a stronger warning 
message that complains about undefined behaviour. 

Best regards,
Daniel Marjamäki

..................................................................................................................
Daniel Marjamäki Senior Engineer
Evidente ES East AB  Warfvinges väg 34  SE-112 51 Stockholm  Sweden

Mobile:                 +46 (0)709 12 42 62
E-mail:                 [email protected]

www.evidente.se

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

Reply via email to