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

--- Comment #11 from _artem_ <artemeas at gmail dot com> 2011-07-17 00:30:11 
UTC ---
ok... sorry.

it seams to be a avr-g++ bug or arduino bug. 

Or avr-g++ has changed something in 4.6.1 so const declarations changed. (Then
it's arduino teams job to fix the headers)

Ok now I know that the command line is:

avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections
-mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=22 1.cpp

1.cpp (as you asked):
extern const int __attribute__((progmem)) p[];

it gives:
1.cpp:1:45: error: variable 'p' must be const in order to be put into read-only
section by means of '__attribute__((progmem))'

when I add before the "extern ..." something like:
const int p[];

it gives me:
1.cpp:1:11: error: uninitialized const 'p' [-fpermissive]
1.cpp:1:13: error: storage size of 'p' isn't known
1.cpp:2:45: error: variable 'p' must be const in order to be put into read-only
section by means of '__attribute__((progmem))'

So I have now no idea if it's arduino's headers, or avr-g++ is guilty.

p.s. here is the thread I started on arduino forum (maybe it'll be usefull for
you...): http://arduino.cc/forum/index.php/topic,66710.0.html

Reply via email to