prog_char and pgm_read_byte won't work

Running the following program results with “10B 91” on the Serial Monitor indicating 0x91 is stored at or read from address 0x010B rather than 0x00. Please advise. Any and all help is appreciated.


byte flag=0;
prog_char jazz0=0x00;

void setup() {

void loop() {
  if (flag == 0) {
    Serial.print  ((int)&jazz0, HEX);
    Serial.print  (' ');
    Serial.println(pgm_read_byte(&jazz0), HEX);

I have no idea why your code does not work but this does work...

prog_char jazz0 PROGMEM =0x00;

Can someone explain the syntax of this one please? If typedef char PROGMEM prog_char; (from "pgmspace.h").

isn't prog_char jazz0 PROGMEM =0x00; somewhat tautological?

Would a simple "const" suffice?

Your help is appreciated. "prog_char jazz0 PROGMEM =0x00;" works. All is now well.

isn't somewhat tautological?

My suspicion is there is a bug or deficiency in the compiler.

Would a simple "const" suffice?

No. The difference is where the data is stored. PROGMEM places the data in Flash. const places the data in SRAM.

Looks like the same bug described here:

There hasn't been any word on this since I submitted the bug to the gcc group back in august.