getopt: misc cleanups for compiler warning

getopt.c:124:1: warning: function 'usage' could be declared with
                attribute 'noreturn' [-Wmissing-noreturn]
This commit is contained in:
Aaron Jones 2017-07-31 05:17:10 +00:00
parent 8c8a219e71
commit 7406d7acad
No known key found for this signature in database
GPG key ID: 8AF0737488AB3012
2 changed files with 3 additions and 2 deletions

View file

@ -39,7 +39,6 @@ struct lgetopt
extern struct lgetopt myopts[]; extern struct lgetopt myopts[];
void usage(char *);
void parseargs(int *, char ***, struct lgetopt *); void parseargs(int *, char ***, struct lgetopt *);
#endif /* __GETOPT_H_INCLUDED__ */ #endif /* __GETOPT_H_INCLUDED__ */

View file

@ -30,6 +30,8 @@
# define OPTCHAR '-' # define OPTCHAR '-'
static void usage(char *name) __attribute__((noreturn));
void void
parseargs(int *argc, char ***argv, struct lgetopt *opts) 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) usage(char *name)
{ {
int i = 0; int i = 0;