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

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

Re: [avr-gcc-list] How to place data in FLASH on GCC 3.2 (avrfreaks)?


From: Larry Barello
Subject: Re: [avr-gcc-list] How to place data in FLASH on GCC 3.2 (avrfreaks)?
Date: Tue, 10 Sep 2002 14:54:21 -0700

Ok, I believe you, but the GCC "using and porting" man pages doesn't say
this.  In fact they give examples of type attributes being set within
"typedef" constructs in the page "Specifying Attributes of Type"

So, is this a new rule?  Is this something that will periodically change
at the whim of a developer?  Or is this a bug in 3.2?

----- Original Message -----
From: "Joerg Wunsch" <address@hidden>


> "Larry Barello" <address@hidden> wrote:
>
> > This works under 3.02 (avrfreaks) but fails on 3.2 (experimental)
because
> > the data gets placed in SRAM rather than FLASH.
> >
> > #define FLASH __attribute__ ((progmem))
> > typedef struct
> > {
> >     ...
> > } const FLASH SomeStruct;
> >
> > SomeStruct MyData = {...};
> >
> >
> > Why?
>
> Because __attribute__ ((foo)) is apparently only honored within a
> variable declaration, not within a typedef.
>
> Since __attribute__ is a gcc extension, there's nothing the C standard
> would tell you about this.



avr-gcc-list at http://avr1.org



reply via email to

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