Am I doing something wrong with PROGMEM?

Hello,
In my simple sketch I am getting a ton of warnings for all of the variables I set in an included MemConstants.h file. Do I need to be concerned with these warnings?

In file included from progmemtest.ino:2:
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:7: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:8: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:9: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:10: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:11: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:12: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:13: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:14: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:15: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:16: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:17: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:18: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:19: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:20: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:21: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:22: warning: only initialized variables can be placed into program memory area
/Users/SNE/CloudDrive/MacSNE/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:23: warning: only initialized variables can be placed into program memory area

Here is the main program progmemtest.ino:

#include <MemConstants.h> 
#include <avr/pgmspace.h>

void setup() {

  Serial.begin(115200); 
  Serial.write("Here we go...\n");
  
  Serial.write("num64=");
  Serial.println(pgm_read_byte_near(&NUM64));
}


void loop(void) {

}

And here is MemConstants.h:

#ifndef MemConstants_h
#define MemConstants_h

#include "Arduino.h"
#include <avr/pgmspace.h>

static prog_uint8_t NUM0 PROGMEM=0;
static prog_uint8_t NUM1 PROGMEM=1;
static prog_uint8_t NUM2 PROGMEM=2;
static prog_uint8_t NUM3 PROGMEM=3;
static prog_uint8_t NUM4 PROGMEM=4;
static prog_uint8_t NUM5 PROGMEM=5;
static prog_uint8_t NUM6 PROGMEM=6;
static prog_uint8_t NUM7 PROGMEM=7;
static prog_uint8_t NUM8 PROGMEM=8;
static prog_uint8_t NUM9 PROGMEM=9;
static prog_uint8_t NUM10 PROGMEM=10;
static prog_uint8_t NUM11 PROGMEM=11;
static prog_uint8_t NUM12 PROGMEM=12;
static prog_uint8_t NUM64 PROGMEM=64;
static prog_uint8_t NUM255 PROGMEM=0xFF;
static prog_uint8_t NUM254 PROGMEM=0xFE;
static prog_uint16_t NUM512 PROGMEM=512;
#endif

Thanks in advance for the assistance

Your header file makes it look like you are declaring a variable called NUM0 and a variable called PROGMEM, and assigning a value to PROGMEM. I think that you have PROGMEM in the wrong place.

PaulS:
Your header file makes it look like you are declaring a variable called NUM0 and a variable called PROGMEM, and assigning a value to PROGMEM. I think that you have PROGMEM in the wrong place.

I made the changes but still get a similar warning:

#ifndef MemConstants_h
#define MemConstants_h

#include "Arduino.h"
#include <avr/pgmspace.h>


static prog_uint8_t PROGMEM NUM64 =64;

#endif

here is the warning:

In file included from progmemtest.ino:3:
/SoftwareTools/Arduino/Arduinoprogs/libraries/MemConstants/MemConstants.h:8: warning: only initialized variables can be placed into program memory area

There is a known bug that PROGMEM generates spurious warnings when compiling C++. See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734 http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=57011

I believe it is fixed in a version of AVR-GCC that has not been picked up by Arduino. My reading leads me to believe that it is harmless.

I asked this exact same question before and got told to just ignore the warnings.

For compatibility with more recent versions of the compiler, you should add "const" as well, and NOT use prog_xxx types:

static const uint8_t PROGMEM NUM0 =0;