NO

Author Topic: How to get more info on compiler warnings and error  (Read 4158 times)

ghasemicompany

  • Guest
How to get more info on compiler warnings and error
« on: November 17, 2013, 06:02:30 AM »
Some errors and warnings are ambiguous and need more explanation. For example in:
warning #2117: Old-style function definition for 'main
Where can I see the format of the new style of main function so I can remove this warning?
Please do not tell me to lower the compiler warning level.
« Last Edit: November 18, 2013, 03:42:30 AM by ghasemicompany »

Offline DMac

  • Member
  • *
  • Posts: 272
Re: How to get more info on compiler warnings and error
« Reply #1 on: November 18, 2013, 06:34:29 PM »
The Pelles C, new project wizard, for a console app generates this correct example:

Code: [Select]
int main(int argc, char *argv[])
{
    printf("Hello, world!\n");
    return 0;
}
If you don't need the arguments, this is acceptable
Code: [Select]
int main(void)
{
    printf("Hello, world!\n");
    return 0;
}


No one cares how much you know,
until they know how much you care.

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: How to get more info on compiler warnings and error
« Reply #2 on: November 18, 2013, 10:08:59 PM »
Some errors and warnings are ambiguous and need more explanation. For example in:
warning #2117: Old-style function definition for 'main
Where can I see the format of the new style of main function so I can remove this warning?
Please do not tell me to lower the compiler warning level.
a) ANSI/ISO C docs
b) online help (C program startup)

Not sure if in this case the warning is ambiguous, it's rather straight to the point. Pelle's C is a fairly strict ANSI/ISO C compiler (C11 in the latest version), and unless you would indeed disable those level of warnings, will tell you when you get lazy and do not adhere to the standard...

Ralf

nehaali

  • Guest
Re: How to get more info on compiler warnings and error
« Reply #3 on: November 25, 2013, 06:54:55 AM »

Thank you  for your work!
But as a friend of ancient operating systems, I would like to say that GetRegValueW is available only in Vista and above.