Hi

Call me a newbie, but is there anything wrong with the following statement?

rtc.time_element.tm_wday = (rtc.time_element.tm_wday < 6) ? rtc.time_element.tm_wday++ : 0;

I checked K&R and it looks OK to me.
In WINAVR 20081205 the expression rtc.tm_wday++ doesn't appear to be evaluated.
The assembler looks like:

rtc.time_element.tm_wday = (rtc.time_element.tm_wday < 6) ? rtc.time_element.tm_wday++ : 0;
1ca:    80 91 77 01     lds    r24, 0x0177
1ce:    86 30           cpi    r24, 0x06    ; 6
1d0:    08 f0           brcs    .+2          ; 0x1d4 <rt_clock+0x42>
1d2:    80 e0           ldi    r24, 0x00    ; 0
1d4:    80 93 77 01     sts    0x0177, r24

Thanks

_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to