This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix implicit-fallthrough warnings in tst-setjmp.c


Building the testsuite with -Wextra (together with
-Wno-cast-function-type -Wno-clobbered -Wno-expansion-to-defined
-Wno-missing-field-initializers -Wno-old-style-declaration
-Wno-shift-negative-value -Wno-sign-compare -Wno-type-limits
-Wno-unused-parameter, which reflect the set of -Wextra warnings for
which glibc itself is not currently clean on x86_64) showed up
implicit-fallthrough warnings in tst-setjmp.c.  Those warnings appear
to be false positives, arising from a function "jump" that calls
longjmp not itself being marked as noreturn; thus, this patch adds the
noreturn marking to that function to fix the warnings.

Tested for x86_64.

2019-02-14  Joseph Myers  <joseph@codesourcery.com>

	* setjmp/tst-setjmp.c (jump): Use __attribute__ ((__noreturn__)).

diff --git a/setjmp/tst-setjmp.c b/setjmp/tst-setjmp.c
index e83e896ebe..b377393ecf 100644
--- a/setjmp/tst-setjmp.c
+++ b/setjmp/tst-setjmp.c
@@ -22,7 +22,7 @@
 static jmp_buf env;
 static int last_value = -1, lose = 0;
 
-static void
+static __attribute__ ((__noreturn__)) void
 jump (int val)
 {
   longjmp (env, val);

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]