NO

Author Topic: warning #2117: Old-style function definition for 'main'.  (Read 8434 times)

Hemanth

  • Guest
warning #2117: Old-style function definition for 'main'.
« on: January 22, 2017, 07:27:40 PM »
int main(){
}
Produces this warning
warning #2117: Old-style function definition for 'main'.


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

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: warning #2117: Old-style function definition for 'main'.
« Reply #1 on: January 22, 2017, 09:26:10 PM »
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