提交 579e1452 编写于 作者: K Kees Cook 提交者: Linus Torvalds

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':
>> lib/string.c:986:1: warning: 'noreturn' function does return
    }
    ^

Link: http://lkml.kernel.org/r/20170627192050.GA66784@beastSigned-off-by: NKees Cook <keescook@chromium.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 6974f0c4
...@@ -48,6 +48,7 @@ do { \ ...@@ -48,6 +48,7 @@ do { \
"i" (__FILE__), \ "i" (__FILE__), \
"i" (__LINE__), "i" (0), \ "i" (__LINE__), "i" (0), \
"i" (sizeof(struct bug_entry))); \ "i" (sizeof(struct bug_entry))); \
unreachable(); \
} while (0) } while (0)
#define __WARN_FLAGS(flags) \ #define __WARN_FLAGS(flags) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册