[Answered, thanks] Leaving the () of a function call

I accidentally left the () off a function call, typing:

// instead of

Needless to say it didn't call void pulseLED(), but of course it did after I noticed and put the () in.

But I'm confused why it compiled.....

the name of a function is a pointer to its location a.k.a. address of the function.
It compiles as addresses of function may occur on the right hand side (RHS) of an expression.

you have the same "problem" with

void setup()
int x;

Such statements with a function behaves much like when you leave the brackets off of an array. That is:

int myArray[20];


uses pass-by-reference to pass the lvalue (base memory address) of the array to the function. If you call PulseLED() without using the parentheses, it resolves the expression to the lvalue of where that function resides in memory. So, it's not a syntax error. Indeed, this is pretty much how pointers to function works.

Hmmm thanks Gents: you both used the dreaded p-word so looks like I'll need to relent and read up on those sometime.

If you do a attachInterrupt(...) you also use a function name without the ().

Then you are in fact passing a pointer to the function to be placed in an table.

Anything that can be evaluated as a value will be considered a valid program line. The fact that you do nothing with that value doesn't make it an error, merely redundant.

You could equally just put

"look even a string";
//All redundant but no error