Skip to content

Use PGM_P instead of prog_char #1695

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

Conversation

matthijskooijman
Copy link
Collaborator

On later versions of avr-libc, prog_char is deprecated. In 0acebee
the one occurence of prog_char was replaced by "char PROGMEM", which is
not entirely correct (PROGMEM is supposed to be an attribute on a
variable, not on a type, even though this is how things work in older
libc versions). However, in 1130fed a few new occurences of
prog_char are introduced, which break compilation on newer libc versions
again.

This commit changes all these pointer types to use the PGM_P macro from
<avr/pgmspace.h>. This macro is just "const char *" in newer libc
versions and "const prog_char *" in older versions, so it should always
work.

References #795

matthijskooijman added a commit to Pinoccio/core-pinoccio that referenced this pull request Nov 20, 2013
The regular arduino core uses some types like prog_char, which are
deprecated on newer avr-libc versions. Since the Pinoccio requires a
newer toolchain than is included with Arduino, this breaks.

A fix is pending in the Arduino repo, but until it is in a released IDE
version, this workaround should fix things. See also
arduino/Arduino#1695
On later versions of avr-libc, prog_char is deprecated. In 0acebee
the one occurence of prog_char was replaced by "char PROGMEM", which is
not entirely correct (PROGMEM is supposed to be an attribute on a
variable, not on a type, even though this is how things work in older
libc versions). However, in 1130fed a few new occurences of
prog_char are introduced, which break compilation on newer libc versions
again.

This commit changes all these pointer types to use the PGM_P macro from
<avr/pgmspace.h>. This macro is just "const char *" in newer libc
versions and "const prog_char *" in older versions, so it should always
work.

References arduino#795
@matthijskooijman
Copy link
Collaborator Author

I just found out I apparently forgot to commit a part of the change, I updated the pullrequest (force-pushed). The commit now also replaces the const char PROGMEM * introduced by 0acebee with PGM_P.

@cmaglie
Copy link
Member

cmaglie commented Jan 5, 2014

This has been manually merged.
C

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

Successfully merging this pull request may close these issues.

2 participants