To my surprise I haven't been able to find an answer to this - maybe I don't search well...
Anyway, I'm trying to do something fairly common, I presume: put some data (structs) into progmem, and put an array of pointers to those structs in progmem as well. Like this:
typedef struct ST_S { int i1; int i2; } ST; ST S1 PROGMEM = { 1, 2 }; ST S2 PROGMEM = { 3, 4 }; ST S3 PROGMEM = { 5, 6 }; ST S4 PROGMEM = { 7, 8 }; ST * ST_array[] PROGMEM = { &S1, &S2, &S3, &S4 };
I can see from the list file that the structs and the array go into progmem correctly, and the array is correctly filled. But I get this warning, which I'd like to eliminate:
../Test.c:19: warning: initialization discards qualifiers from pointer target type
Line 19 is the ST_array line. What am I doing wrong?
Mike