Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp177796imm; Fri, 5 Oct 2018 01:47:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV63XpwO4wX12x+Xps9Qq37JlzDXpgWRyq1pCBYtLdjnJqmAXEg+3q8sfy1lwAdfssqe9GYgc X-Received: by 2002:a62:db46:: with SMTP id f67-v6mr10637621pfg.1.1538729272314; Fri, 05 Oct 2018 01:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538729272; cv=none; d=google.com; s=arc-20160816; b=UX5lJlAilUsRGYuNZ/eHFTuVZhgmJ0O1AI4VX4MYU1HM5i9NPj7V0R66foVeqsql3n iAlYAlB7ZrD3ggbt0o9Yhi31eZ+l7/9IAVoHxPuWVs902/ML4JZrJbOxEyLyrYiafsvp afqrDz3lN+mqMf7AoF6G/3W7lAexldiDQD3BiMKSqNz2mVM7+k/lI8rjCnNoCZaP1wc9 hiQ6XVyflWPYPC7dX19mn9L+vq4O9LlEKe3Sa6kaF5+xEcy2nhsTXfyO1tP/VM0qsa8g Z2V/HCmhawWDVgATMPyNE1PwsyLYmQtNs1ruaujLFAQUt1Mt+pFdhpulGf4zHJwICbn0 ycsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:reply-to :dkim-signature; bh=88oXG8X372b/WHjutXhAw0Ec0H1FJsKhdXj/ng33GtQ=; b=AuMBEkeTQXqIIl6ZKbWaJOpk7RhSyMZzgh4rjETpzDFIDpwWk209pYj0XBUDwQa4mg NDmXOsjcYHBmTfOiRTSa5iphoINUv3z/rFhpIKirhMGskvimiEMj52Tw/XYkh6+umcqJ bLG14KVh8dEvX4mp6Rz9b9/eAkWhUiCRK+fcL3os7c7bxFzxdGgryNtkXp102pfz3GZV CBpHMkb8Ss2Lmr4RaH1JbUtCxtxaygul2C0aJMiA0G5O2OUfhaTkj1MG1GnRbgqUfByv ZsQ54Q8/rZsOeHoJzO/Q2F7R9LVW2OTB4bW7h0Y8/YDlui37+6qisSROtj4IUl8ZuUKo g/tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=no6ZApMX; 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 k70-v6si7138380pgd.2.2018.10.05.01.47.35; Fri, 05 Oct 2018 01:47:52 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=no6ZApMX; 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 S1728596AbeJEPpM (ORCPT + 99 others); Fri, 5 Oct 2018 11:45:12 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:47244 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727783AbeJEPpM (ORCPT ); Fri, 5 Oct 2018 11:45:12 -0400 Received: from [192.168.0.21] (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F2EB219E6; Fri, 5 Oct 2018 10:47:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1538729246; bh=5cISgKifriNSupDXNiNaXhwWI5lXVEU7L5mY6MwTcro=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=no6ZApMX5HlYoJwZ4jxOaHpScWnaCa2wj4JB9M7MkHuEMwaug6MEASTtl6oi1ByU+ MeMPWZlBJqkaXR2mMVixks4rcRQxXy+FE5xVJscR26uQ2ALoJdTSNGw1dHaA2pGWTo c2wbjuw8zhWu+zGGip6GUJh5tzinCSRkzCGaiWdQ= Reply-To: kieran.bingham+renesas@ideasonboard.com Subject: Re: [PATCH] kbuild: fix kernel/bounds.c 'W=1' warning To: Arnd Bergmann , Andrew Morton Cc: linux-renesas-soc@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, yamada.masahiro@socionext.com References: <20180921142234.16882-1-kieran.bingham+renesas@ideasonboard.com> <20181005083313.2088252-1-arnd@arndb.de> From: Kieran Bingham Organization: Ideas on Board Message-ID: Date: Fri, 5 Oct 2018 09:47:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181005083313.2088252-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On 05/10/18 09:33, Arnd Bergmann wrote: > Building any configuration with 'make W=1' produces a warning: > > kernel/bounds.c:16:6: warnign: no previous prototype for 'foo' [-Wmissing-prototypes] > s/warnign/warning/ but I don't think that's too important :D > 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. Aha - even better! (and annoyingly fairly obvious, from the Why-didn't-I-think-of-that department). > Reported-by: Kieran Bingham > Cc: stable@vger.kernel.org > Signed-off-by: Arnd Bergmann Reviewed-by: Kieran Bingham > --- > 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; > } >