PROGMEM in library generates spurious (?) warning

I've been trying to "fix" the PS2Keyboard library for current Arduino software, and I've got it mostly working, but I get these warnings about the PROGMEM tables in the library:

PS2Keyboard-n.cpp:36: warning: only initialized variables can be placed into program memory area
PS2Keyboard-n.cpp:37: warning: only initialized variables can be placed into program memory area

which I get regardless of which variation of progmem-style declaration is used (prog_uchar or prog_char instead of PROGMEM, PROGMEM in various positions, etc, etc.)

The actual code looks like

#define PS2_KC_LUT_CAPACITY 10
const PROGMEM unsigned char PS2_KC_LUT_DATA[PS2_KC_LUT_CAPACITY] = {0x70, 0x69
, 0x72, 0x7a, 0x6b, 0x73, 0x74, 0x6c, 0x75, 0x7d};
const PROGMEM unsigned char PS2_KC_LUT_CHAR[PS2_KC_LUT_CAPACITY] = {'0', '1', 
'2', '3', '4', '5', '6', '7', '8', '9'};

So the data is surely initialized. And it looks like the code produced is correct with the tables in the right place. The warning will not happen if the PROGMEM table is moved into the sketch pde, only when it's in the library .cpp file (libraries are compiled with -Wall; manually compiling without -Wall also removes the warning. But that'd be little comfort to beginners trying to use the library!

Any ideas on what is actually going on?

Some searching of the internet with the Google-brand search engine (a.k.a "Googling") suggests this is a known issue with GCC/C++. If you surrounded the section with the extern C voodoo it might make the warning go away.


I just stumbled across this little warning myself. I wanted to add a flash-based lookup table to NewSoftSerial and while it seems to be working, I'm not at all happy that the compiler generates the spooky warning. Adding extern "C" to the data in question doesn't seem to remove it. Any further intelligence on this topic?