From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753401AbdF0TVB (ORCPT ); Tue, 27 Jun 2017 15:21:01 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:32934 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752311AbdF0TUw (ORCPT ); Tue, 27 Jun 2017 15:20:52 -0400 Date: Tue, 27 Jun 2017 12:20:50 -0700 From: Kees Cook To: Andrew Morton Cc: Yoshinori Sato , Rich Felker , Peter Zijlstra , Ingo Molnar , linux-sh@vger.kernel.org, Daniel Micay , linux-kernel@vger.kernel.org Subject: [PATCH] sh: mark end of BUG() implementation as unreachable Message-ID: <20170627192050.GA66784@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 } ^ Cc: Yoshinori Sato Cc: Rich Felker Cc: Daniel Micay Signed-off-by: Kees Cook --- arch/sh/include/asm/bug.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sh/include/asm/bug.h b/arch/sh/include/asm/bug.h index 1b77f068be2b..c9828f785ca0 100644 --- a/arch/sh/include/asm/bug.h +++ b/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) \ -- 2.7.4 -- Kees Cook Pixel Security