Skip to content

Arduino 1.5.7 - example compilation issue #2217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
morterman opened this issue Aug 1, 2014 · 3 comments
Closed

Arduino 1.5.7 - example compilation issue #2217

morterman opened this issue Aug 1, 2014 · 3 comments

Comments

@morterman
Copy link

the Robot_Control / examples / explore / R06_Wheel_Calibration does not compile with new gcc/libc - "PROGMEM const char *scripts[]" seems to be erratic (error sugests that the var shoud be const).

the same construct is sugested on http://arduino.cc/en/Reference/PROGMEM (in the "Arrays of strings" paragraph) - and this should be fixed as well.

@matthijskooijman
Copy link
Collaborator

The file is here:

https://github.com/arduino/Arduino/blob/ide-1.5.x/libraries/Robot_Control/examples/explore/R06_Wheel_Calibration/scripts_library.h

PROGMEM const char *scripts[]={ ... }

What I think this says is that scripts is an array, pointing to const char *. The scripts variable itself is put into PROGMEM (since PROGMEM is always a modifier to the variable being declared, not the (array element) type, regardless of where it's placed).

Adding another after the * should fix it. Also, moving PROGMEM to the end can clarify things and emphasize that it applies to the variable, not its type. e.g.:

const char * const scripts[] PROGMEM = { ... }

Could you see if this compiles as expected?

@morterman
Copy link
Author

yes, I can confirm, that "const char * const scripts[] PROGMEM = { ... }" compiles correcly.

cmaglie added a commit that referenced this issue Nov 5, 2014
@cmaglie
Copy link
Member

cmaglie commented Nov 5, 2014

Fixed for next release. Thanks!

@cmaglie cmaglie closed this as completed Nov 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants