|
Post by jackroffel on Nov 21, 2015 21:05:06 GMT -8
Hi all,
I am getting the following compiler warning using Arduino 1.6. Was not too worried about it until I realized this is the copy function used by LOAD_ASSETS() which I just starting playing with ...
GD2.cpp:297:43: warning: '__progmem__' attribute ignored [-Wattributes] void GDClass*:copy(const uint8_t PROGMEM *src, int count) {
... is this of any concern? Any suggestions to fix this?
Jack
|
|
|
Post by jamesbowman on Nov 22, 2015 1:56:56 GMT -8
Hmm, I do not get that warning when compiling with 1.6.0 - it compiles completely clean.
What board are you compiling for? I am building for Arduino Uno btw.
|
|
|
Post by jackroffel on Nov 22, 2015 10:39:50 GMT -8
James,
I am using a Arduino Mega 2560 and compiling with Visual Micro/Microsoft Visual Studio Community 2015. I could have been more specific - the Arduino version being used is 1.6.5.
If I compile the Walk example from within the actual IDE I do get the same error.
D:\Data\Dropbox\Arduino Sketchbook\libraries\Gameduino2\GD2.cpp:297:43: warning: '__progmem__' attribute ignored [-Wattributes] void GDClass::copy(const uint8_t PROGMEM *src, int count) {
Jack
|
|
|
Post by jackroffel on Nov 22, 2015 11:32:48 GMT -8
James,
I installed and compiled with 1.6.0, and you are correct. It compiles clean.
1.6.5 has some SPI transaction features that are beneficial to a GD2 project with multiple SPI devices, so I am reluctant to go back to 1.6.0.
Any ideas?
Jack
|
|
|
Post by jackroffel on Nov 22, 2015 16:18:00 GMT -8
James, I did a little more research. From forum.arduino.cc/index.php?topic=349789.0"Progmem means nothing to the compiler (only the linker uses it). You cannot mark a function parameter as PROGMEM and expect anything different to the non PROGMEM version, its a data attribute not a type modifier, so it is completely ignored." I removed the PROGMEM from the function parameter, and it compiles without any errors. Since the function explicitly uses "pgm_read_byte_near" the PROGMEM is redundant. Jack
|
|