diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-09-16 14:52:42 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-10-17 07:37:39 +0200 |
commit | d76f5774fe70c51577cfbfdddcbfb3309d51f06e (patch) | |
tree | 579994269a0b9d569e0ac2b4ca024e8027dc4551 /extra | |
parent | 3b7aa3017b65dcf11d33617e954e1cb471703582 (diff) | |
download | mariadb-git-d76f5774fe70c51577cfbfdddcbfb3309d51f06e.tar.gz |
MDEV-13459 Warnings, when compiling with gcc-7.x
mostly caused by -Wimplicit-fallthrough
Diffstat (limited to 'extra')
-rw-r--r-- | extra/my_print_defaults.c | 21 | ||||
-rw-r--r-- | extra/replace.c | 1 |
2 files changed, 14 insertions, 8 deletions
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index 7558d6d00ae..4690b29e8a5 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -97,12 +97,16 @@ static struct my_option my_long_options[] = }; -static void usage(my_bool version) +static void version() { - printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, - MACHINE_TYPE); - if (version) - return; + printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE); +} + + +static void usage() __attribute__ ((noreturn)); +static void usage() +{ + version(); puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n"); puts("Prints all arguments that is give to some program using the default files"); printf("Usage: %s [OPTIONS] [groups]\n", my_progname); @@ -126,12 +130,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), exit(0); case 'I': case '?': - usage(0); + usage(); case 'v': verbose++; break; case 'V': - usage(1); + version(); + /* fall through */ case '#': DBUG_PUSH(argument ? argument : default_dbug_option); break; @@ -179,7 +184,7 @@ int main(int argc, char **argv) nargs+= array_elements(mysqld_groups); if (nargs < 2) - usage(0); + usage(); load_default_groups=(char**) my_malloc(nargs*sizeof(char*), MYF(MY_WME)); if (!load_default_groups) diff --git a/extra/replace.c b/extra/replace.c index 56cf02f2002..2ad4979c09e 100644 --- a/extra/replace.c +++ b/extra/replace.c @@ -174,6 +174,7 @@ register char **argv[]; break; case 'V': version=1; + /* fall through */ case 'I': case '?': help=1; /* Help text written */ |