Function not called

All:

Ok, this may be a dumb question, but had me pulling my hair out for awhile. So I created a simple function/method in a sketch.

void clearEEPROM() {
    for (int i = 0 ; i < EEPROM.length() ; i++) {
    EEPROM.write(i, 0xFF);
  }
}

In the sketch I used clearEEPROM; and it never was called, yet no compile error. Couldn't figure out why...

When I used clearEEPROM(); it worked fine when using the parenthesis.

Did I write the function wrong, or am I missing something, sorry as it's probably a basic 101 programming question, but had me stumped for awhile.

The second version with parentheses is the correct way to call a function.

If you had warnings switched on you would have seen a warning in the first case. But the statement is not illegal it's just pointless so the compiler doesn't flag it as an error.

Steve

Thank you. I did check my preferences and the compiler warnings were set to default. No compiler messages came through. When I changed it to "More" or "All" it indeed gave me a warning.