tools/mkpasswd.c: misc cleanup for compiler warnings

mkpasswd.c:516:1: warning: function 'full_usage' could be declared with
                  attribute 'noreturn' [-Wmissing-noreturn]

mkpasswd.c:537:1: warning: function 'brief_usage' could be declared with
                  attribute 'noreturn' [-Wmissing-noreturn]
This commit is contained in:
Aaron Jones 2017-07-31 01:55:24 +00:00
parent 3f7ccca917
commit 28541a0d96
No known key found for this signature in database
GPG key ID: 8AF0737488AB3012

View file

@ -49,8 +49,8 @@ static char *int_to_base64(int);
static char *generate_random_salt(char *, int); static char *generate_random_salt(char *, int);
static char *generate_poor_salt(char *, int); static char *generate_poor_salt(char *, int);
static void full_usage(void); static void full_usage(void) __attribute__((noreturn));
static void brief_usage(void); static void brief_usage(void) __attribute__((noreturn));
static char saltChars[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static char saltChars[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
/* 0 .. 63, ascii - 64 */ /* 0 .. 63, ascii - 64 */
@ -150,11 +150,9 @@ main(int argc, char *argv[])
case 'h': case 'h':
full_usage(); full_usage();
/* NOT REACHED */ /* NOT REACHED */
break;
case '?': case '?':
brief_usage(); brief_usage();
/* NOT REACHED */ /* NOT REACHED */
break;
default: default:
printf("Invalid Option: -%c\n", c); printf("Invalid Option: -%c\n", c);
break; break;
@ -511,7 +509,7 @@ generate_random_salt(char *salt, int length)
return (salt); return (salt);
} }
void static void
full_usage() full_usage()
{ {
printf("mkpasswd [-m|-d|-b|-e] [-l saltlength] [-r rounds] [-s salt] [-p plaintext]\n"); printf("mkpasswd [-m|-d|-b|-e] [-l saltlength] [-r rounds] [-s salt] [-p plaintext]\n");
@ -532,7 +530,7 @@ full_usage()
exit(0); exit(0);
} }
void static void
brief_usage() brief_usage()
{ {
printf("mkpasswd - password hash generator\n"); printf("mkpasswd - password hash generator\n");