main() /* assumed to return int */
{
printf ("hello world\n");
} /* WARNING: no return statement */void main() /* function declared to return void */
{
printf ("hello world\n");
}enum type. For example:
enum Day { Sunday, Monday, Tuesday, Wednesday,
Thursday, Friday, Saturday } d;
d = 5; /* WARNING */
d = Monday; /* OK */
d = (Day)3 ; /* OK */return statement (return;) in a function that is not declared void. For example, this code would generate a warning:
int MyInit(void)
{
int err = GetMyResources();
if (err !=0) return; /* ERROR: Empty return statement */
/* ... */int MyInit(void)
{
int err = GetMyResources();
if (err!=0) return -1; /* OK */
/* ... */
The Extended Error Checking option corresponds to the pragma extended_errorcheck, described at "extended_errorcheck." To check whether this option is on, use __option (extended_errorcheck). See "Checking Options" for information on how to use this directive.