This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/38342] [4.4/4.5/4.6/4.7 Regression] __attribute__((__progmem__)) not propagated from typedef to data


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38342

--- Comment #11 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-07-05 08:43:17 UTC ---
(In reply to comment #10)
> I was using documented avr-libc features.  Does that mean that this is an
> avr-libc bug rather than a gcc bug?  Neither of the web pages you reference
> mention "progmem" or even AVR at all...

As I wrote, the linked pages show that progmem is not documented for types.
For progmem on variables, you have to switch to the "Specifying Attributes of
Variables" section of user manual:

trunk:
http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html#Variable-Attributes

or, e.g. 4.5.2:
http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/Variable-Attributes.html#Variable-Attributes

The AVR section is at the end of the page, dunno why the ordering is not
correct.

I just can speculate about the reason why these types are defined in avr-libc,
I guess it's for historical reasons and legacy code.

avr-libc cannot ensure a feature that avr-gcc does not provide.

It's agreed by the avr maintainers to do nothing about that, so the only thing
that could help you to find respective flaces in your sources would be a
typedef like

typedef char __attribute__((progmem,deprecated("attribute 'progmem' in typedef
is an undocumented feature"))) prog_char;

in avr-libc that triggered a diagnostic:

foo.c:4:17: warning: 'prog_char' is deprecated (declared at foo.c:2): attribute
'progmem' in typedef is an undocumented feature [-Wdeprecated-declarations]

However, that won't help with your own typedefs.

At current, progmem for types appears to work for C and not to work for C++,
but that can change in the future.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]