On Jan 14, 2013, at 2:56 PM, Nick Lewycky <[email protected]> wrote:
> On 14 January 2013 14:52, Nick Lewycky <[email protected]> wrote:
> This patch adds the -reverse-order flag which reverses the order of 
> evaluation of simple (non-complex non-aggregate) assignment expressions (eg., 
> "a() = b();" where a() returns int& and b() returns int). The idea is to 
> provide a debugging tool that we can use to identify bugs in user code caused 
> by order of evaluation problems. As a starting point, I've only reversed one 
> such evaluation (one that causes me much grief), but I'd also like to change 
> the order of function parameter evaluation. Others may be added on an 
> as-needed basis.

This is an interesting idea, but I'm pretty worried about it.  I understand
that this isn't your intent, but in effect you *are* talking about
implementing a knob that can be tweaked by users (even if it's an internal
option that we don't document and never claim to support) in order to force
a particular evaluation order on the compiler.  Especially when you're
talking about extending it to (accidentally, no doubt!) exactly match GCC's
argument evaluation.

Basically, it sounds an awful lot like something that some understaffed
porting effort or over-conservative platform maintainer will eventually
make us regret ever implementing.

Is there some way you can achieve your goal that doesn't leave us
vulnerable to that?

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

Reply via email to