Hi Bill,

>> Ralf Koetter's code used a number of constructions like the following:
>>
>>      for (y = m2-1-x; y; ) d[y--] = p[y];
>>
>> The clang compiler flagged these with warnings like this:
>>
>>      warning: unsequenced modification and access to 'y'
> Yes, that is undefined behaviour.

Yes.  Also hard to read and make sense of.  :-)

>> Somewhere between gcc 4.6.3 and gcc 4.8.1, the GNU folks did something
>> that changed the ordering of copy and decrement in the original statement.
> Probably more aggressive optimization, compilers are free to reorder
> expressions where the Standard doesn't define a strict sequencing.

FWIW: With the original expressions in the code, gcc 4.8.1 ordered the 
operations the "wrong" (read "unintended") way, even with no 
optimization flag (or -O0) specified.

        -- Joe

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
wsjt-devel mailing list
wsjt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wsjt-devel

Reply via email to