Skip to contentSkip to conversation

sh-mark-end-of-bug-implementation-as-unreachable.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jul 13, 2017

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: sh: mark end of BUG() implementation as unreachable
has been removed from the -mm tree. Its filename was
sh-mark-end-of-bug-implementation-as-unreachable.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Kees Cook <[email protected]>
Subject: sh: mark end of BUG() implementation as unreachable

When building the sh architecture, the compiler doesn't realize that BUG() doesn't return, so it will complain about functions using BUG() that are marked with the noreturn attribute:

lib/string.c: In function 'fortify_panic':

Quoted 1 line
Quoted 1 line

lib/string.c:986:1: warning: 'noreturn' function does return

    }
    ^

---

 arch/sh/include/asm/bug.h |    1 +
 1 file changed, 1 insertion(+)
arch/sh/include/asm/bug.h renamed from arch/sh/include/asm/bug.h~sh-mark-end-of-bug-implementation-as-unreachable +1 -0
diff -puN arch/sh/include/asm/bug.h~sh-mark-end-of-bug-implementation-as-unreachable arch/sh/include/asm/bug.h
@@ -48,6 +48,7 @@ do {							\
 		   "i" (__FILE__),			\
 		   "i" (__LINE__), "i" (0),		\
 		   "i" (sizeof(struct bug_entry)));	\
+	unreachable();					\
 } while (0)
 
 #define __WARN_FLAGS(flags)				\

_

Patches currently in -mm which might be from [email protected] are