"Bob Paddock" wrote:

>>>   for(;;)
>>>     {
>>>       uint8_t byte_u8 = LED2H; // Start LED
>> 
>> You're initializing the variable inside the loop.
> 
> I knew I was overlooking the obvious.  Thanks.
> 
> Still not sure why I was getting the warning about byte_u8
> not being used, when it was not in the loop, which
> is how it got in there in the first place, trying to figure
> out where the warning was coming from.
> 
> I deleted the .dep directory and OBJs then recompiled, and it went
> away.

The declaration would be fine if it were static
i.e.
for (;;) {
    static uint8_t byte_u8 = LED2H;  // Start LED
    ...
}

In this case the initial assignment is guaranteed to happen only once, but
obviously, static is not what you always want, but in this particular case
it would also fix the problem.

-Preston




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

Reply via email to