Re: 8/16bit oddities on avr-gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Michael Kukat" <michael@xxxxxxxxxxxx> writes:

> Hello,
>
> i'm programming a lot of AVR firmware since a while, first in pure
> assembler, as gcc 3.x didn't produce code i liked very much. But the
> 4.1.1 i'm currently using produces quite good code if you sometimes
> try around to get the best results (as in "i would write nearly the
> same in assembler").
>
> But now, i found one strange thing where i currently can't find a
> workaround i really like. It's about a quite simple loop here:
>
> This is my perftest.c file:
> #include <avr/io.h>
> #include < inttypes.h>
>
> volatile uint8_t xx;
>
> void test() {
>        uint8_t ctr;
>
>        ctr = 0;
>        do {
>                xx = ctr;
>        } while(++ctr < 64);

Try "while((uint8_t)(++ctr) < 64)"

-- 
Sergei.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux