|Subject:||[avr-gcc-list] re: compiler bug?|
|Date:||Tue, 10 Feb 2009 15:50:25 +0000|
|User-agent:||Thunderbird 220.127.116.11 (Windows/20081209)|
Thanks OleksandrSorry, pre-increment also is "UB" because of undefined order of store-back operation for pre-increment and assignment. The only correct version rtc.time_element.tm_wday = (rtc.time_element.tm_wday < 6) ? rtc.time_element.tm_wday+1 : 0; Again:But on my taste if( ++rtc.time_element.tm_wday >= 6 ) rtc.time_element.tm_wday = 0; is better solution (generates smaller code)
I reverted to the 3 line full version, all explicit statements to avoid confusion.
FYI The compiler does not produce any warning with -Wall (my default config)
|[Prev in Thread]||Current Thread||[Next in Thread]|