]> granicus.if.org Git - check/commitdiff
Fix warnings by flag -Wswitch-default
authorMikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Tue, 13 Aug 2019 18:53:46 +0000 (20:53 +0200)
committerMikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Wed, 28 Aug 2019 11:03:24 +0000 (13:03 +0200)
E.g.
check_print.c:114:13: warning: switch missing default case [-Wswitch-default]
             switch (next)
             ^

Signed-off-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
src/check_print.c
tests/check_check_master.c

index 35f13b64aa7d30584b8e92bd31c520e907323ac9..a9f3aea427f061cbd8bb97c997059ffe3b485109 100644 (file)
@@ -128,6 +128,9 @@ void fprint_xml_esc(FILE * file, const char *str)
                 case '&':
                     fputs("&amp;", file);
                     break;
+                default:
+                    /* Program cannot reach here */
+                    break;
             }
         }
         /* printable ASCII */
index 2dd049183a9b2be50d0ec2a09789392bc9d35a82..245fd15d2832a4bde98587d64ece0b46dfe00144 100644 (file)
@@ -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) {