[v2] newlib/libc/include/setjmp.h: Add returns_twice attribute to setjmp()
Commit Message
The setjmp() function needs this attribute to help GCC avoid false
positives for the -Wclobbered warning. The -Wclobbered warning is
part of -Wextra.
---
newlib/libc/include/setjmp.h | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
@@ -11,13 +11,17 @@
_BEGIN_STD_C
-#ifdef __GNUC__
void longjmp (jmp_buf __jmpb, int __retval)
- __attribute__ ((__noreturn__));
-#else
-void longjmp (jmp_buf __jmpb, int __retval);
+#ifdef __GNUC__
+ __attribute__ ((__noreturn__))
+#endif
+ ;
+
+int setjmp (jmp_buf __jmpb)
+#ifdef __GNUC__
+ __attribute__ ((returns_twice))
#endif
-int setjmp (jmp_buf __jmpb);
+ ;
_END_STD_C