Skip to content

PROGMEM Reference documentation needs updating due to GCC changes #2647

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
pfeerick opened this issue Feb 16, 2015 · 1 comment
Closed

PROGMEM Reference documentation needs updating due to GCC changes #2647

pfeerick opened this issue Feb 16, 2015 · 1 comment
Assignees
Labels
Component: Documentation Related to Arduino's documentation content Type: Duplicate Another item already exists for this topic

Comments

@pfeerick
Copy link
Contributor

Was just putting together a new project, and the demo code used PROGMEM to save some SRAM space. It declared an array in memory for a image for the OLED display with the following initialiser...

prog_uchar welcomeimage[] PROGMEM = {

However, that doesn't work with 1.6.0 when compiled for a Arduino Pro Mini /w Atmega328, and I would get the following error:

GraphicLCDAdapaterDemo.ino:15:1: error: 'prog_uchar' does not name a type

After some prodding around, either of the following lines do work correctly:

const PROGMEM uint8_t welcomeimage[] = {
const uint8_t welcomeimage[] PROGMEM = {

I saw a reference in the changelog at 1.5.7 Beta to "* avr: Fixed PROGMEM statements to be compatible with newer avr gcc (Scott Howard)" - and after finding the commit 33b1e7c I realised it was fixing the symptoms not the problem.

Can somebody update the reference page @ http://arduino.cc/en/Reference/PROGMEM (and thus also the bundled documentation!) as it now clear that the prog_char and prog_uchar (and probably none of the other) variables no longer work. And variables now need to be declared const also.

Just using #define __PROG_TYPES_COMPAT__ as suggested in <avr/pgmspace.h> will not work without also adding the const parameter. Plus this not really a fix as these typedefs are all deprecated.

@ffissore ffissore added the Component: Documentation Related to Arduino's documentation content label Feb 16, 2015
@cmaglie cmaglie added the Type: Duplicate Another item already exists for this topic label Feb 17, 2015
@cmaglie
Copy link
Member

cmaglie commented Feb 17, 2015

Duplicate of #1536

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Related to Arduino's documentation content Type: Duplicate Another item already exists for this topic
Projects
None yet
Development

No branches or pull requests

4 participants