Is there a known bug in g++ 4.3.0 with respect to atributes that are a part of a typedef or something? I have this trivial program pgmspace.c:
Code:
BillW-MacOSX<1059> cat pgmspace.c
#include <avr/pgmspace.h>
prog_uchar foo [10][10] = { 0 };
BillW-MacOSX<1060>
When compiled with gcc, it does what I expect:
Code:
BillW-MacOSX<1060> /Downloads/arduino-0012/hardware/tools/avr/bin/avr-gcc pgmspace.c -mmcu=atmega168 -c -o pgmspace43cc.o --version
avr-gcc (GCC) 4.3.0
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
BillW-MacOSX<1061> /Downloads/arduino-0012/hardware/tools/avr/bin/avr-gcc pgmspace.c -mmcu=atmega168 -c -o pgmspace43cc.o
BillW-MacOSX<1062> /Downloads/arduino-0012/hardware/tools/avr/bin/avr-size pgmspace43cc.o
text data bss dec hex filename
100 0 0 100 64 pgmspace43cc.o
BillW-MacOSX<1063>
But when compiled with g++, the data is NOT put in program memory:
Code:
BillW-MacOSX<1063> /Downloads/arduino-0012/hardware/tools/avr/bin/avr-g++ pgmspace.c -mmcu=atmega168 -c -o pgmspace43c++.o --version
avr-g++ (GCC) 4.3.0
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
BillW-MacOSX<1064> /Downloads/arduino-0012/hardware/tools/avr/bin/avr-g++ pgmspace.c -mmcu=atmega168 -c -o pgmspace43c++.o
BillW-MacOSX<1065> /Downloads/arduino-0012/hardware/tools/avr/bin/avr-size pgmspace43c++.o
text data bss dec hex filename
0 0 100 100 64 pgmspace43c++.o
(Yes, this is the pre-built macos binary distributed with the Arduino environment. Can someone try it with a more normal distribution?)
I can't tell whether this is related or not:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734 |