<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 26, 2013, at 4:19 , Daniel Marjamäki <<a href="mailto:Daniel.Marjamaki@evidente.se">Daniel.Marjamaki@evidente.se</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Jordan!<br><br><blockquote type="cite">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?<br></blockquote><br>Yes this is true now as we are only checking comparison operators. However:<br><br>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 ||.<br><br>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. <br></blockquote></div><br><div>We actually do have that already:</div><div><br></div><div><div><div><font face="Courier"><span style="font-size: 11px;"><stdin>:3:2: warning: multiple unsequenced modifications to 'x' [-Wunsequenced]</span></font></div><div><font face="Courier"><span style="font-size: 11px;">        ++x == ++x;</span></font></div><div><font face="Courier"><span style="font-size: 11px;">        ^      ~~</span></font></div></div></div><div><br></div><div>So maybe it's okay.</div><div><br></div><div>Jordan</div></body></html>