avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] Re: AVR-chat Digest, Vol 17, Issue 12


From: David Brown
Subject: Re: [avr-chat] Re: AVR-chat Digest, Vol 17, Issue 12
Date: Fri, 16 Jun 2006 13:58:13 +0200

The attributes are documented in the gcc documentation:
http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Variable-Attributes.html#Variable-Attributes
 
There is no "used" attribute for variables - the nearest is in fact "unused", which is close to what you think you want.  However, attributes are not the answer here - even if the "used" attribute existed for variables.  You cannot possibly get the effect you are looking for, because there is no way for the compiler to guarentee the ordering of data within a section.  The way to deal with this is to use a struct containing all your eeprom data.
 
mvh.,

David
 
 
----- Original Message -----
Sent: Thursday, June 15, 2006 9:50 PM
Subject: [avr-chat] Re: AVR-chat Digest, Vol 17, Issue 12


For the optimization issue, you could try __attribute__((used)) . This way you
tell the compiler to assume that the variable is used even if it actually
isn't.


I thought there would be something like that around.  Where are all the possible "__attribute__"'s listed in the docs, by chance, I'm becoming interested...

Steve


_______________________________________________
AVR-chat mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-chat

reply via email to

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