From d76f5774fe70c51577cfbfdddcbfb3309d51f06e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 16 Sep 2017 14:52:42 +0200 Subject: MDEV-13459 Warnings, when compiling with gcc-7.x mostly caused by -Wimplicit-fallthrough --- extra/my_print_defaults.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'extra/my_print_defaults.c') 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) -- cgit v1.2.1