Strange behavior of compiler

Hi

Why the compiler does not report error in this code:

void SetUpIOPins();
....

void setup() {
// open the serial port:
Serial.begin( BAUD_RATE ); //( 115200 );
void SetUpIOPins();
....
}

The compiler simply ignore the word void inside the function Setup() and doesn't call the function SetUpIOPins(). Is it normal?

I am using arduino IDE version is 1.5.6 r2 and a Due.

Thanks

its a function declaration, not a definition, so it is fine.
and its also not a function call as you assumed.

Using it inside the function restricts its visibility to that scope.

It is similar to using a 'using' declaration inside a function. It avoids cluttering up the global namespace.
The function referenced is in the global scope, however it may not be visible ( through a missing header inclusion or other ). But multiple declarations are fine as long as they match.

Hi pYro_65:

Thanks for your reply, I didn't realized that is possible to define a function inside another function., in this case it was a mistake, I forgot to delete the word "void" in order to call the function not to define it.

I didn't realized that is possible to define a function inside another function.

In some dialects of C it is, but not this one.

C++11 has lambda expressions which are like functions that can be declared anywhere a statement can be written.

I didn't realized that is possible to define a function inside another function.

But to re-cap, that is not defining a function, it is only declaring that one exists somewhere. Just to be picky...