From 7406d7acadd99fe8c453361ba4c9e4d340c734d1 Mon Sep 17 00:00:00 2001 From: Aaron Jones Date: Mon, 31 Jul 2017 05:17:10 +0000 Subject: [PATCH] getopt: misc cleanups for compiler warning getopt.c:124:1: warning: function 'usage' could be declared with attribute 'noreturn' [-Wmissing-noreturn] --- include/ircd_getopt.h | 1 - src/getopt.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/ircd_getopt.h b/include/ircd_getopt.h index ddc9e4da..87b6ec41 100644 --- a/include/ircd_getopt.h +++ b/include/ircd_getopt.h @@ -39,7 +39,6 @@ struct lgetopt extern struct lgetopt myopts[]; -void usage(char *); void parseargs(int *, char ***, struct lgetopt *); #endif /* __GETOPT_H_INCLUDED__ */ diff --git a/src/getopt.c b/src/getopt.c index aff907e6..ece8f8c6 100644 --- a/src/getopt.c +++ b/src/getopt.c @@ -30,6 +30,8 @@ # define OPTCHAR '-' +static void usage(char *name) __attribute__((noreturn)); + void parseargs(int *argc, char ***argv, struct lgetopt *opts) { @@ -119,7 +121,7 @@ parseargs(int *argc, char ***argv, struct lgetopt *opts) } } -void +static void usage(char *name) { int i = 0;