public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gjl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/38342] [4.4/4.5/4.6/4.7 Regression] __attribute__((__progmem__)) not propagated from typedef to data
Date: Tue, 05 Jul 2011 08:44:00 -0000	[thread overview]
Message-ID: <bug-38342-4-uvRTbrxpKx@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-38342-4@http.gcc.gnu.org/bugzilla/>

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.


  parent reply	other threads:[~2011-07-05  8:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-38342-4@http.gcc.gnu.org/bugzilla/>
2011-06-27 12:48 ` [Bug target/38342] [4.3/4.4/4.5/4.6/4.7 " rguenth at gcc dot gnu.org
2011-07-03 20:56 ` [Bug target/38342] [4.4/4.5/4.6/4.7 " gjl at gcc dot gnu.org
2011-07-05  0:23 ` westfw at yahoo dot com
2011-07-05  8:44 ` gjl at gcc dot gnu.org [this message]
2011-07-06 21:18 ` westfw at yahoo dot com
2012-02-06 13:56 ` gjl at gcc dot gnu.org
2021-11-05 23:19 ` timturnerc at yahoo dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-38342-4-uvRTbrxpKx@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).