From 6a03cd237a2e85600275a358430ea544f53aba3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Wed, 23 Sep 2020 13:55:01 +0200 Subject: [PATCH] Avoid warning about unreachable break statement htop.c:112:13: warning: 'break' will never be executed [-Wunreachable-code-break] break; ^~~~~ htop.c:109:13: warning: 'break' will never be executed [-Wunreachable-code-break] break; ^~~~~ --- htop.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/htop.c b/htop.c index 7bd15291..fbd6dee4 100644 --- a/htop.c +++ b/htop.c @@ -29,13 +29,10 @@ in the source distribution for its full text. //#link m -ATTR_NORETURN static void printVersionFlag(void) { fputs("htop " VERSION "\n", stdout); - exit(0); } -ATTR_NORETURN static void printHelpFlag(void) { fputs("htop " VERSION "\n" "Released under the GNU GPL.\n\n" @@ -54,7 +51,6 @@ static void printHelpFlag(void) { "Press F1 inside htop for online help.\n" "See 'man htop' for more information.\n", stdout); - exit(0); } // ---------------------------------------- @@ -106,10 +102,10 @@ static CommandLineSettings parseArguments(int argc, char** argv) { switch (opt) { case 'h': printHelpFlag(); - break; + exit(0); case 'V': printVersionFlag(); - break; + exit(0); case 's': if (strcmp(optarg, "help") == 0) { for (int j = 1; j < Platform_numberOfFields; j++) {