From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2332 invoked by alias); 5 Jul 2011 08:44:12 -0000 Received: (qmail 2323 invoked by uid 22791); 5 Jul 2011 08:44:11 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_GJ X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Jul 2011 08:43:57 +0000 From: "gjl at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gjl at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P5 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.4.7 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 05 Jul 2011 08:44:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg00291.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38342 --- Comment #11 from Georg-Johann Lay 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.