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

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

Re: [avr-gcc-list] Tiny88 C++ code optimized out of existence?


From: Bob Paddock
Subject: Re: [avr-gcc-list] Tiny88 C++ code optimized out of existence?
Date: Wed, 14 Jan 2009 14:36:02 -0500

>> 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.

Thanks.

The real problem I'm trying to fix is the warning message
that tells me byte_u8 is defined but not used.

Code is running on the board now, outputs changing,
so byte_u8 is obviously being used.  However the warning
has come back.

I got started down the wrong path by moving where
byte_u8 was located in trying to remove the warning.

This time deleting .dep and OBJs did not make the warning go away.
Bazaar.




reply via email to

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