Hi Johann, I understand your reasoning, but I'm not particularly fond of this hack.
Surely there's a way to fix this correctly without relying on this hack... Eric Weddington > -----Original Message----- > From: Georg-Johann Lay [mailto:a...@gjlay.de] > Sent: Wednesday, June 15, 2011 3:26 PM > To: gcc-patches@gcc.gnu.org > Cc: Weddington, Eric; Anatoly Sokolov; Denis Chertykov > Subject: [Patch, AVR]: Hack around PR34734 > > PR34734 is an annoying, false C++ warning for code like > > const int x __attribute__((progmem)) = 1; > > progmem.c:1:30: warning: only initialized variables can be placed into > program memory area [enabled by default] > > The problem is that DECL_INITIAL is NULL at the specific point in > space and time (avr_handle_progmem_attribute) even though tree.def > promises otherwise. > > The patch hacks around by explicitly querying for C++ front end. > > Johann > > -- > > PR target/34734 > * config/avr/avr.c (avr_handle_progmem_attribute): Hack around > non-present DECL_INITIAL if front end is C++.