Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp193990imm; Fri, 5 Oct 2018 02:08:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV60708jopQkbkE7HOYTTAiN+VUX+S/DJuFQHNLnLjqA78dUPBpSQVwKgSGbYpqYUCYuoCuf5 X-Received: by 2002:a65:5347:: with SMTP id w7-v6mr9446866pgr.17.1538730482717; Fri, 05 Oct 2018 02:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538730482; cv=none; d=google.com; s=arc-20160816; b=Sdpbsc/hYKXq5s30fBekfLSe1awX9uUvcWDQceAh3QDhXGgBfmPLgghE+df4GawOa9 UKN3DLwJzqkzKBBogUg7CJjWvI8V0M0PJ1qhj8//kWOSiDAR+JyiSefq0v8igFIsDQdk HaTIhZXHB8MaHCPbItjllBsoMP5StlxRIJysEWZBZx7kiaHhVHuxSZgbLHRxgWpMasvy U9TT94UFq11MNgOi8skzkV7cKLC8sCJ8KRjTESq1s47Kcld25ANN05uH36jK9+F7sBhn Z6aZpmtZ6U/cuPN8lb+MzvhaKf1IEIAHXmrf3CpR1D+o3tfYkukPg1V9+vne/AFnswal C0Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=htNP80o6BBkOtuNFFZJZQK0NcflO1dHa27ZKc+DFtlY=; b=BtHD1ZwTgDD6YjJda4teNqJtlZCiuf2FzvfbCJTCql7p7mXi8BbAON1TXUQ0ec/3gV qHR3LLpnjyNMTI7i7P/4a5hrB4NcJkLFnw2DD4m9yTRTV+tsOm9fWzJUzkrw5A4KF8Xg OGgX/ctDmc2vAiGGJ0MnoansYm17d9DCCJgL6kdDoY7g0quzeJugV1bJHdIviidKxTJ3 FxgCLS23nYOpBcyQqquIiJcn6i6IpmT2P9p6S9pesC6cS5qJDPE0WmCWBREbL6TqZkaP R2Abpj8k67k6ZltRZzVBHRG1u827qcVijrjS7rCPhGw1Vh/POIMgNHS+wWdZ4uVbDLQr xbyQ== 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 145-v6si7953995pgd.509.2018.10.05.02.07.45; Fri, 05 Oct 2018 02:08:02 -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 S1728689AbeJEQF3 (ORCPT + 99 others); Fri, 5 Oct 2018 12:05:29 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:37885 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728433AbeJEQF2 (ORCPT ); Fri, 5 Oct 2018 12:05:28 -0400 Received: by mail-qk1-f196.google.com with SMTP id x8-v6so7474799qka.4; Fri, 05 Oct 2018 02:07:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=htNP80o6BBkOtuNFFZJZQK0NcflO1dHa27ZKc+DFtlY=; b=V+VUqgU+A6a1Who/eo20/iro81WutakcsXhrNbHe6ZviA9HZA49hXFGbLIhURgI7gP Ep4w5RX5oOfiA6tYSyQ3Nvxxrzn12PCKhrPakj0o7OlexLNEyfp3H68fiJoEMeeJyqLz iynMoc4zWtqQxZ34d4Seq1ph04BJMmSGMYQa2Gzp5LMTA7XQ8y/Gz4SDVq+bTIoivwfx ddEUj5N6IYOVBqj+VjAhoWhY/pwcuRK9Uu8GMH+IjlSCFYOneH2XKva+MLAlZYNc6zgK uBNo4j7cpmurtdpllY5EVU1Wb+EWhFpGSuHvc9XG/mkBO5bh0Xcw3UYQHjDXDRFB+5VP dJ3w== X-Gm-Message-State: ABuFfoieUHc6hVAOG1h5bF/cu5jP/1JTAM74tdkwg7tFDOpsND/EAFC9 MHjkdm7+5VQdiOmxRKaI66jfexsZZqG0NTiV755zPTPz X-Received: by 2002:a37:7347:: with SMTP id o68-v6mr8397175qkc.291.1538730458842; Fri, 05 Oct 2018 02:07:38 -0700 (PDT) MIME-Version: 1.0 References: <20180921142234.16882-1-kieran.bingham+renesas@ideasonboard.com> <20181005083313.2088252-1-arnd@arndb.de> <08b190b9dabd4625ae3d636b88b43ccb@AcuMS.aculab.com> In-Reply-To: <08b190b9dabd4625ae3d636b88b43ccb@AcuMS.aculab.com> From: Arnd Bergmann Date: Fri, 5 Oct 2018 11:07:22 +0200 Message-ID: Subject: Re: [PATCH] kbuild: fix kernel/bounds.c 'W=1' warning To: David Laight Cc: Andrew Morton , Linux-Renesas , kieran.bingham+renesas@ideasonboard.com, "# 3.4.x" , Linux Kernel Mailing List , Linux Kbuild mailing list , Masahiro Yamada Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 5, 2018 at 10:52 AM David Laight wrote: > > From: Arnd Bergmann > > Sent: 05 October 2018 09:33 > > > > 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. > > Ugg. > main() might be special in other ways too. > It wouldn't surprise me if some linkers don't do special stuff for it. > > What is wrong with just putting and extra "void foo(void);" before > the function? Greg objected to that on the basis that we don't want declarations in .c files -- they should be in a shared header: https://lkml.org/lkml/2018/9/21/735 I don't see what could go wrong here with calling it main(), after all we are just interested in the assembler output, not even creating an object file. Arnd