[False asumption, sorry!] Unused functions are compiled, how to avoid this?

The compiler's pretty aggressive about removing stuff. For example:

void setup () 
  { 
  }
void loop () {}

Gives:

Binary sketch size: 310 bytes (of a 2,048 byte maximum)

Add a large array:

byte foo [1000] = { 1, 2, 3, 4 };

void setup () 
  { 
  }
void loop () {}

Gives:

Binary sketch size: 310 bytes (of a 2,048 byte maximum)

No change.


Refer to something in the array, and not only does it generate code to do that, it includes the array in the object:

byte foo [1000] = { 1, 2, 3, 4 };

void setup () 
  { 
  foo [0] = 1; 
  }
void loop () {}

Gives:

Binary sketch size: 1,316 bytes (of a 2,048 byte maximum)