If I do the following:
typedef char my_prog_char __attribute__ (( progmem ));
my_prog_char gMyProgString[] __attribute__ (( progmem )) = "XYZ";
The initial "XYZ" string will properly be thrown into the
.progmem.data section, which merges to the .text section. But if I
instead do this:
typedef char my_prog_char __attribute__ (( progmem ));
my_prog_char *gMyProgString __attribute__ (( progmem )) = "XYZ";
The initial "XYZ" string will be thrown into the .data section.
My problem is that I want to do a typedef or something that let's me
do this:
prog_string my_array[] = {
"string1",
"string2",
"string3"
}
And each string gets the progmem attribute tagged to it.
Unfortunately, I can't typedef prog_string like this:
typedef prog_char prog_string[] __attribute__ (( progmem ))
because the compiler complains about the open-ended array without
initial value.
Can someone explain how gcc treats pointers to char (char *var)
differently than arrays of char (char var[]) and why gcc treats
initial data differently depending on which form is chosen?
Thanks,
Tyler
_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list