From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 15 Jan 2022 03:33:21 +0000 (-0800)
Subject: tests: pacify nvc 22.1 unreachable statement
X-Git-Tag: v1.0~2395
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=261712b93effaccb148f68f2002cfb94540efc78;p=gnulib.git

tests: pacify nvc 22.1 unreachable statement

* tests/test-sys_wait.h (test_sys_wait_macros):
Widen scope of ‘#if 0’ so that there is not an unreachable ‘break;’.
---

diff --git a/ChangeLog b/ChangeLog
index 5fb16542aa..9113099129 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2022-01-14  Paul Eggert  <eggert@cs.ucla.edu>
 
+	tests: pacify nvc 22.1 unreachable statement
+	* tests/test-sys_wait.h (test_sys_wait_macros):
+	Widen scope of ‘#if 0’ so that there is not an unreachable ‘break;’.
+
 	tests: pacify nvc 22.1 set-but-not-used
 	* tests/test-fnmatch.c (main): Don’t set a var without using it.
 	* tests/test-sched.c (f1): Now extern.
diff --git a/tests/test-sys_wait.h b/tests/test-sys_wait.h
index 50c7d5e8b1..9becf28ebb 100644
--- a/tests/test-sys_wait.h
+++ b/tests/test-sys_wait.h
@@ -40,14 +40,14 @@ test_sys_wait_macros (void)
     }
   i = WEXITSTATUS (i) + WSTOPSIG (i) + WTERMSIG (i);
 
+#if 0
   switch (i)
     {
-#if 0
   /* Gnulib doesn't guarantee these, yet.  */
     case WNOHANG:
     case WUNTRACED:
-#endif
       break;
     }
+#endif
   return 0;
 }