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

guix:
I clicked Verify, then looked the resulting .cpp.o file in IDA and saw that "func" was still present.

Yeah, check this out:

void setup()
{
}

void loop()
{
  //func();
}

void func()
{
  char str[256];
  sprintf(str, "blablablablablabla");
}

Gives:

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

Same as the empty sketch.