warning #2117: Old-style function definition for 'main'.

Started by Hemanth, January 22, 2017, 07:27:40 PM

Previous topic - Next topic

Hemanth

int main(){
}
Produces this warning
warning #2117: Old-style function definition for 'main'.


Simple Solution
-----------------
int main(void){
}

frankie

This is not a bug.
C99-C11 requires parameters qualification. If you want to use the alternative form of main without parameters, allowed by standard, you must specify 'void' for no parameters.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide