Why doesn't PROGMEM increase binary sketch size?

Hey guys,

I’m wiritng a program to output some data to a DAC, and I’m using an AtMega328.

I was looking at this code to determine how to use PROGMEM and work with interrupts:

But when I included sounddata.h into my program, and ran a test compile, my binary sketch size didn’t go up at all, let alone by the 10000 bytes of data the sounddata array contains.

I tried adding:
int lastSample = pgm_read_byte(&sounddata_data[sounddata_length-1]);

Into my code to make sure the compiler wasn’t just optimizing the data away because it was never accessed, but no dice.

I also added:
#include <avr/pgmspace.h>

To the top of my code, but the compiler didn’t complain when I used the PROGMEM keyword or the function to read the data without that in place. So I wonder if that is even needed?

So what’s going on here? Does PROGMEM data not show up in the binary sketch size? Or is the data actually missing? I haven’t gotten to the point in my code yet where I can output the sound, so I don’t know if the data’s there, but I guess I’ll output it over the serial connection or something to find out in a few minutes.

False alarm. Apparently simply grabbing an int out of the array wasn't enough to force the compiler to include the whole thing. But as soon as I added code to print the first few values from it, the sketch size went way up.