On 06/27/2010 06:52 AM, Enrico Weigelt wrote:
remark #981: operands are evaluated in unspecified order (tons of them)
       return strcmp( left.c_str(), right.c_str() )>  0;

I'm not sure if this really qualifies an warning, since - AFAIK -
C spec never said, that there is an evaluation order for
function parameters.


I could see how somebody might make that assumption (incorrectly), and get burned by this. However, creating local variables just to hold intermediate results so as to not embed them in function calls seems to be a lot of overhead - certainly in terms of readability, and I can't think of a situation where the compiler would have to do it on its own. I guess religiously doing this might make the code less likely to contain very subtle bugs, but perhaps it is a bit over the top for anybody who wouldn't be otherwise developing in ADA.

Rich

Reply via email to