Mark functions not returning as sudo_noreturn

We also put NOTREACHED where it applies.
This commit is contained in:
Rose
2023-07-01 14:04:22 -04:00
parent 97e574091a
commit 45fdfa18f1
24 changed files with 47 additions and 35 deletions

View File

@@ -77,5 +77,5 @@ main(int argc, char *argv[])
printf("%s: %d tests run, %d errors, %d%% success rate\n",
getprogname(), ntests, errors, (ntests - errors) * 100 / ntests);
}
exit(errors);
return errors;
}

View File

@@ -113,5 +113,5 @@ main(int argc, char *argv[])
printf("%s: %d tests run, %d errors, %d%% success rate\n",
getprogname(), ntests, errors, (ntests - errors) * 100 / ntests);
}
exit(errors);
return errors;
}

View File

@@ -38,7 +38,7 @@ sudo_dso_public int main(int argc, char *argv[]);
# define GROUP_SOURCE_ADAPTIVE GROUP_SOURCE_DYNAMIC
#endif
static void
sudo_noreturn static void
usage(void)
{
fprintf(stderr, "usage: %s [-v] conf_file\n", getprogname());
@@ -64,6 +64,7 @@ main(int argc, char *argv[])
break;
default:
usage();
/* NOTREACHED */
}
}
argc -= optind;