Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp168476imm; Fri, 5 Oct 2018 01:35:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV60vHQyhl4w3I9dj+khdjoWdjj0KUpgMkfNn4hIPKpTMtmAa2hUMjLzUUnfY97l27UEhn9Po X-Received: by 2002:a63:78cc:: with SMTP id t195-v6mr9193730pgc.329.1538728516310; Fri, 05 Oct 2018 01:35:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538728516; cv=none; d=google.com; s=arc-20160816; b=XlU6g4QztP1Sgba9wOKFM84sXPa1QiqVKvtmxaNN2oUoRc4xkQ4j2fxYFy6IKkNqlm kBeYjEyBVblJ9CUBl+Z+rKxq9yKPeXA8vjZN39pRV7QaB3F7pHTEPT1Ht0SAd1qeXi6t 6wPnEs55DcsxHvV88dVxEc8HOCaO4d0u9E5JOGv+hWJKiWRil9zPbASqKjJZ5iuUNNRO plbJLLlndRdmIinsgY9VjWL/mql/ZIzMfCJoaRaze0caElFyCky4b02vDbMxpFxV3XK+ 9ucRlFROrr/Hdz3H1kqYvu4pCKq4ScIPy2spt3x3d3P2KTeDXM3soWfMcCmljD0Hyps1 MZ+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=gJ85Fg73m4e6Gm/M1YhW+rfQgmuK06Ldyp1FksSka04=; b=bQocI2bBHoSzHQiXnwf5iI/ibVJdcDImOqr3qjmxNeQR1jUuNFOxmkpCD3RR/E+284 luRA7IwYJVDn9G2B7dKpiSmeoXLHSnB15/vUM9btN/EyAkhDktAnF3kugKfLjSlsuTQD sUcP8i2mV/HnY0k5lN2fYcCRj0SMmdOZ9Vpb6etqGQc/5u3MZlJf2fzz06dCuAq6cHoR fjFiFbiIQA4T5clBRUdMSaEVH0EM6T8KT45fXKsyEP11Z5Pbc0EQBllZTk5BmkggjUdy bkYuCET0TMo8nlLtc2kcdwK25wlOtDZrLe4XqptDHW4Og4tMb196MMctNi2mdt7AtMip 0D5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4-v6si7798979pgm.591.2018.10.05.01.34.59; Fri, 05 Oct 2018 01:35:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728592AbeJEPbH (ORCPT + 99 others); Fri, 5 Oct 2018 11:31:07 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:53573 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727750AbeJEPbG (ORCPT ); Fri, 5 Oct 2018 11:31:06 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MsJXG-1fsc7G2Jli-00thjs; Fri, 05 Oct 2018 10:33:20 +0200 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MsJXG-1fsc7G2Jli-00thjs; Fri, 05 Oct 2018 10:33:20 +0200 From: Arnd Bergmann To: Andrew Morton Cc: linux-renesas-soc@vger.kernel.org, Kieran Bingham , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, yamada.masahiro@socionext.com, Arnd Bergmann Subject: [PATCH] kbuild: fix kernel/bounds.c 'W=1' warning Date: Fri, 5 Oct 2018 10:33:13 +0200 Message-Id: <20181005083313.2088252-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180921142234.16882-1-kieran.bingham+renesas@ideasonboard.com> References: <20180921142234.16882-1-kieran.bingham+renesas@ideasonboard.com> X-Provags-ID: V03:K1:eSd4N3smMHCfUFjJFljqXtcK91JFZmx2RfcWSHInkLBfiD7xq5v P264HkIKnrVNh4BWEkE4PHYs5stZrJXLRICxtqFL7AJFD2ujiEQP10LG6VEdC84Ln2wpkFk X2iUIHAtxlCSHa323jMrdRQCzq+/aWTnS4B9qZnByyeVl6d9IaDE0lstRH5Dj6LESTrcqsf jQR8Gh9qBSnr5Uk7DCr0g== X-UI-Out-Filterresults: notjunk:1;V01:K0:d/K1V4pDUnc=:3Rl49oCLPskCTsCWUhET/Y eKsqj02irIOQNE4RjLVw5XKTNDCgGbKFNv/pPce0wfisGvej37ZCs6DjKg32JaIExL+yCk0g9 XLLZ910t60mpQ5R53uA1VNps1m/hkid1CgwdHIbK/Uc1wUHtumV1q0pxPwDgNt1AA8si/wae1 g/Ob+SWFE2ENq0+/ap94w9Xg9InfHyaQ84sFND8Xzy1mGrB2cup+MGIDgVpQi+QD7HKjRfq6f EcxFBccXtNxRQ9HzIwoG6fc9qDox7eYd68B1DbNuxqL6pp4nAGbDUZR5baDG7I0vJDGOiAVKH uqUrOtC4tRdcxP0m4U+lnBKRcGwic0WRSfPJKlqcMPFjcOi4hHgjthqS5+3qM9ghA8Y8bVix2 TBFUSD9TdW0yNngeKAEeCdVBbVi6Pft7DyoDQOK8FHia0Kpe72gjTCdEyVouGEohqhLJQ954T GFQZQOxGrgxMBXhLDhuHvcaLg7iMOK+CeHSY4XZ74Ypj713I6S9hRQ2oGmG4hI8ngqbMDhuak KkkYgEtBYzoRNsbCdkae44tkvPVu2bQLH92vSJiHbJAZMwTUbCSTLxE5ECFwS2I9LRBQtO6N1 LDdQQ6GD2SD5OcXrEfBkYDVKOsXOu+n9vgKPvtg/+JVmxupt4xHVAdpT0uvyxAE/LU1sPE9ii YCV98HLq+QLSkArfZgNaQ/Yz5HCyITcx/ldvlUBXy2CLtdXz0moAa+1qmHwuYL0x22p0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Building any configuration with 'make W=1' produces a warning: kernel/bounds.c:16:6: warnign: no previous prototype for 'foo' [-Wmissing-prototypes] When also passing -Werror, this prevents us from building any other files. Nobody ever calls the function, but we can't make it 'static' either since we want the compiler output. Calling it 'main' instead however avoids the warning, because gcc does not insist on having a declaration for main. Reported-by: Kieran Bingham Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann --- I have run into this problem several times before, and thought I had sent a fix at some point. Looking in the archives, I came across the suggested fix from Kieran, so I'm following up on that here. --- kernel/bounds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/bounds.c b/kernel/bounds.c index c373e887c066..9795d75b09b2 100644 --- a/kernel/bounds.c +++ b/kernel/bounds.c @@ -13,7 +13,7 @@ #include #include -void foo(void) +int main(void) { /* The enum constants to put into include/generated/bounds.h */ DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS); @@ -23,4 +23,6 @@ void foo(void) #endif DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t)); /* End of constants */ + + return 0; } -- 2.18.0