avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] GCC 3.0.2 unsigned int bug?


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] GCC 3.0.2 unsigned int bug?
Date: Tue, 18 Dec 2001 15:01:12 +0100 (MET)

Chris Elmquist <address@hidden> wrote:

> In any case, here's my "improved" loop, suitable for fooling the optimizer
> today:
> 
> void delay(void)
> {
>         unsigned int    d;
> 
>         for (d=0x1000; d; d--)
>                 __asm__ __volatile__ ( "nop" : : );
> }

If you already know about the volatile keyword, why don't you use it
just right?

void delay(void)
{
        volatile unsigned int d;

        for (d = 0x1000; d; d--)
                ;
}

-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]