Disable -Wmaybe-uninitialized for setjmp
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 31 Dec 2014 03:47:24 +0000 (22:47 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 31 Dec 2014 18:03:10 +0000 (13:03 -0500)
Gcc 4.9.2 complains.

Setting bool err = 0 or something doesn't matter btw; the actual complaint is
for an anonymous variable.  The returns twice might be confusing, or maybe that
the compiler can't see the code for slim_setjmp.  The usages of slim_setjmp in
ASM looks fine (immediately tests eax).

kern/include/setjmp.h

index fd7f28e..2fb30b5 100644 (file)
@@ -8,9 +8,14 @@
 int slim_setjmp(struct jmpbuf *env) __attribute__((returns_twice));
 void longjmp(struct jmpbuf *env, int val) __attribute__((noreturn));
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+
 #define setjmp(jb) ({bool err;                                                 \
                     __ros_clobber_callee_regs();                               \
                     err = slim_setjmp(jb);                                     \
                     err;})
 
+#pragma GCC diagnostic pop
+
 #endif /* !ROS_SETJMP_H */