Compiler bug

not sure but this caused me some headache anyway.

#include <MemoryFree.h>

void setup() {
  Serial.begin(9600);
  Serial.println("Starting up");
}

void loop() {
  Serial.println(freeMemory(), DEC);
  delay(1000);
}

void dummy1() {
  Serial.println("Some text");
}

void dummy2() {
  char txt[] = "Some other text";
  Serial.println(txt);
}

printing from setup causes strings from non-used functions to reserve memory on the 2k stack. If you comment Serial.println(“Starting up”); out dummy1 and dummy2 will not reserve memory unless they are run.

Thought I’d mention this because I just spent 3H understanding why my program crashed.

MrZ