From: Mikko Johannes Koivunalho Date: Tue, 13 Aug 2019 18:53:46 +0000 (+0200) Subject: Fix warnings by flag -Wswitch-default X-Git-Tag: 0.13.0~10^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28598903a383c3013b243f4377a1dd61e1624dad;p=check Fix warnings by flag -Wswitch-default E.g. check_print.c:114:13: warning: switch missing default case [-Wswitch-default] switch (next) ^ Signed-off-by: Mikko Johannes Koivunalho --- diff --git a/src/check_print.c b/src/check_print.c index 35f13b6..a9f3aea 100644 --- a/src/check_print.c +++ b/src/check_print.c @@ -128,6 +128,9 @@ void fprint_xml_esc(FILE * file, const char *str) case '&': fputs("&", file); break; + default: + /* Program cannot reach here */ + break; } } /* printable ASCII */ diff --git a/tests/check_check_master.c b/tests/check_check_master.c index 2dd0491..245fd15 100644 --- a/tests/check_check_master.c +++ b/tests/check_check_master.c @@ -522,6 +522,9 @@ START_TEST(test_check_failure_msgs) break; } #endif /* ENABLE_REGEX */ + default: + /* Program should not reach here */ + break; } if (not_equal) { @@ -712,6 +715,9 @@ START_TEST(test_check_all_msgs) break; } #endif /* ENABLE_REGEX */ + default: + /* Program should not reach here */ + break; } if (not_equal) {