Comments on the patch?
diff -Nru -X dontdiff linux-2.4-vanilla/include/asm-i386/page.h linux-2.4/include/asm-i386/page.h
--- linux-2.4-vanilla/include/asm-i386/page.h Tue Nov 11 18:05:52 2003
+++ linux-2.4/include/asm-i386/page.h Wed Feb 4 14:43:00 2004
@@ -95,14 +95,28 @@
* undefined" opcode for parsing in the trap handler.
*/
+#ifdef __bug
+static inline void __dummy_noreturn(void) __bug;
+static inline void __dummy_noreturn(void) {
+ while(1) {}
+}
+#else
+#define __dummy_noreturn() do {} while(0)
+#endif
+
#if 1 /* Set to zero for a slightly smaller kernel */
-#define BUG() \
- __asm__ __volatile__( "ud2\n" \
- "\t.word %c0\n" \
- "\t.long %c1\n" \
- : : "i" (__LINE__), "i" (__FILE__))
+#define BUG() do { \
+ __asm__ __volatile__( "ud2\n" \
+ "\t.word %c0\n" \
+ "\t.long %c1\n" \
+ : : "i" (__LINE__), "i" (__FILE__)); \
+ __dummy_noreturn(); \
+ } while(0)
#else
-#define BUG() __asm__ __volatile__("ud2\n")
+#define BUG() do { \
+ __asm__ __volatile__("ud2\n"); \
+ __dummy_noreturn(); \
+ } while(0)
#endif
#define PAGE_BUG(page) do { \
diff -Nru -X dontdiff linux-2.4-vanilla/include/linux/compiler.h linux-2.4/include/linux/compiler.h
--- linux-2.4-vanilla/include/linux/compiler.h Tue Sep 18 23:12:45 2001
+++ linux-2.4/include/linux/compiler.h Tue Feb 3 18:29:56 2004
@@ -13,4 +13,11 @@
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
+#if __GNUC__ >= 3
+/* __noreturn__ is implemented since gcc 2.5.
+ * __always_inline__ is not present in 2.9x
+ */
+#define __bug __attribute__((__noreturn__, __always_inline__))
+#endif
+
#endif /* __LINUX_COMPILER_H */