[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a0ZWfjGfpCRzoVw9vg=xg2ov2c7et_qTi5mzd81_RParQ@mail.gmail.com>
Date: Fri, 5 Oct 2018 11:07:22 +0200
From: Arnd Bergmann <arnd@...db.de>
To: David Laight <David.Laight@...lab.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
kieran.bingham+renesas@...asonboard.com,
"# 3.4.x" <stable@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Masahiro Yamada <yamada.masahiro@...ionext.com>
Subject: Re: [PATCH] kbuild: fix kernel/bounds.c 'W=1' warning
On Fri, Oct 5, 2018 at 10:52 AM David Laight <David.Laight@...lab.com> 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
Powered by blists - more mailing lists