[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] An old but unfixed bug
From: |
Jeremy Moc |
Subject: |
RE: [avr-gcc-list] An old but unfixed bug |
Date: |
Tue, 21 Aug 2001 17:38:02 -0500 |
Hi Alexander, I don't think this is a gcc bug per se. Your while condition
is comparing an int (0xffff == -1) cast to a pointer. If your pointer p is
initialised to any value <= 0x7fff your while condition fails on the first
pass. The source file you sent showed p = RAMEND + 1. Usually a small
positive number (eg. 4433 --> 0x15F + 1) so you have:
while ( 352 < -1 ); // fail
Hope this helps,
Jeremy Moc
> Hello,
> Here I send a warning for an old bug which is still not
> fixed. It is a general
> GCC bug, not AVR specific.
> When we have :
>
> unsigned char *p;
> p=(unsigned char*)SOME_ADDR;
> do {
> // do something
> } while(p++<(unsigned char *)0xffff);
>
> The while loop is totaly skipped and the body is executed only once!
>
> Best regards,
> Alexander Popov
>