In the following code snippet, the main function calls foo function without any parameter and parenthesis. It is strange that this code can be compiled by gcc. I actually ch
This is no different than having any other type of expression and ignoring its value, like:
int main(void)
{
42;
return 0;
}
there's nothing special, this is not calling the function since the function-call operators () are not being used. All you're doing is "computing" the functions' address, then ignoring it.