Skip to content

newer gcc requries PROGMEM variables to be consts #1448

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
wants to merge 1 commit into from

Conversation

maqifrnswa
Copy link
Contributor

many examples and libraries fail to build if PROGMEM variables are not declared as consts with newer gcc

@matthijskooijman
Copy link
Collaborator

At first glance, th commit looks ok. I did add a few comments to the commit where things weren't entirely clear.

@leomil72
Copy link

leomil72 commented Jun 5, 2013

prog_char shouldn't be used anymore. It's deprecated too.
PROGMEM const prog_char ---> PROGMEM const char.

@maqifrnswa
Copy link
Contributor Author

All prog_* shouldn't be used anymore, but it will take some effort to hunt them down throughout arduino. I was thinking that defining the macro will at least allow the code to compile and throw warnings to where it should be fixed.

@lestofante
Copy link

in unix you can use grep, in windows notepad++ has a "find INTO files",
thats a lot easyer to look at compiler warning. Also i think arduino code's
should be warning free as much as possible

2013/6/5 Scott Howard [email protected]

All prog_* shouldn't be used anymore, but it will take some effort to hunt
them down throughout arduino. I was thinking that defining the macro will
at least allow the code to compile and throw warnings to where it should be
fixed.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1448#issuecomment-18977518
.

@maqifrnswa
Copy link
Contributor Author

yes, the best thing to do would be sed 's/prog_char/const char/g' for each
file grep -r finds, even write a script to go over each of the deprecated
variables to find them.

I don't have that much time to check and test it all, that's why my
solution was the lazy (or at least lower-work) solution - but I too would
prefer it if someone actually corrects the variables.

On Wed, Jun 5, 2013 at 10:33 AM, lestofante [email protected]:

in unix you can use grep, in windows notepad++ has a "find INTO files",
thats a lot easyer to look at compiler warning. Also i think arduino
code's
should be warning free as much as possible

2013/6/5 Scott Howard [email protected]

All prog_* shouldn't be used anymore, but it will take some effort to
hunt
them down throughout arduino. I was thinking that defining the macro
will
at least allow the code to compile and throw warnings to where it should
be
fixed.


Reply to this email directly or view it on GitHub<
https://github.com/arduino/Arduino/pull/1448#issuecomment-18977518>
.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1448#issuecomment-18979964
.

@matthijskooijman
Copy link
Collaborator

A possible problem with not using prog_char could be that older avr-libc versions require its use (and Arduino still ships these older versions). However, looking at the headers for avr-libc 1.6, it seems that there is not really anything special about these types: http://cvs.savannah.gnu.org/viewvc/avr-libc/avr-libc/include/avr/pgmspace.h?revision=1.40&view=markup&pathrev=avr-libc-1_6-branchpoint

They were just convenience types so you wouldn't have to explicitly type "PROGMEM", I think, so dropping them shouldn't cause any problems.

@cmaglie
Copy link
Member

cmaglie commented Jul 4, 2014

This PR has been manually merged. All the prog_* statements have been removed as well.

Robot_Control: 887d9be
TFT: #2166
GSM: #2164

Thank you!

@cmaglie cmaglie closed this Jul 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core Related to the code for the standard Arduino API Component: Toolchain The tools used for compilation and uploading to Arduino boards
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants