Mark functions not returning as sudo_noreturn
We also put NOTREACHED where it applies.
This commit is contained in:
@@ -21,15 +21,16 @@
|
||||
* PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <config.h>
|
||||
#include <ctype.h>
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sudo_plugin.h"
|
||||
|
||||
|
@@ -195,7 +195,7 @@ main(int argc, char *argv[])
|
||||
break;
|
||||
case 'h':
|
||||
help();
|
||||
break;
|
||||
/* NOTREACHED */
|
||||
case 'i':
|
||||
free(conf->input_format);
|
||||
conf->input_format = strdup(optarg);
|
||||
@@ -258,6 +258,7 @@ main(int argc, char *argv[])
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
argc -= optind;
|
||||
|
@@ -31,7 +31,7 @@
|
||||
|
||||
sudo_dso_public int main(int argc, char *argv[]);
|
||||
|
||||
static void
|
||||
sudo_noreturn static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: %s plugin.so symbols_file\n", getprogname());
|
||||
|
@@ -44,7 +44,7 @@ struct sudo_plugin_event * (*plugin_event_alloc)(void);
|
||||
|
||||
sudo_dso_public int main(int argc, char *argv[], char *envp[]);
|
||||
|
||||
static void
|
||||
sudo_noreturn static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: %s pathname\n", getprogname());
|
||||
|
@@ -65,7 +65,7 @@ check_addr(char *input)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
sudo_noreturn static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: %s datafile\n", getprogname());
|
||||
|
@@ -201,7 +201,7 @@ main(int argc, char *argv[])
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
argc -= optind;
|
||||
@@ -731,7 +731,7 @@ testsudoers_error(const char *buf)
|
||||
return fputs(buf, stderr);
|
||||
}
|
||||
|
||||
static void
|
||||
sudo_noreturn static void
|
||||
usage(void)
|
||||
{
|
||||
(void) fprintf(stderr, "usage: %s [-dt] [-G sudoers_gid] [-g group] [-h host] [-i input_format] [-P grfile] [-p pwfile] [-U sudoers_uid] [-u user] <user> <command> [args]\n", getprogname());
|
||||
|
@@ -197,7 +197,7 @@ main(int argc, char *argv[])
|
||||
break;
|
||||
case 'h':
|
||||
help();
|
||||
break;
|
||||
/* NOTREACHED */
|
||||
case 'I':
|
||||
edit_includes = false;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user