On Sat, Sep 9, 2023, at 14:12, Geert Uytterhoeven wrote:
Hi Arnd,
On Sat, Sep 9, 2023 at 10:28 AM Arnd Bergmann <arnd@xxxxxxxx> wrote:
On Thu, Sep 7, 2023, at 15:41, Geert Uytterhoeven wrote:
When building with W=1:
m68k/arch/m68k/emu/nfeth.c:42:19: warning: ‘version’ defined but
not used [-Wunused-const-variable=]
42 | static const char version[] =
| ^~~~~~~
Fix this while obeying the wishes of the original copyright holders by
marking version[] with __maybe_unused.
Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
That will just drop it from the object file, maybe it should
instead be marked "__used" ?
Given it's been like this since the beginning, I guess it never showed
up in the object file anyway...
Older compilers used to keep unused variables, and all versions
still do when building with -O0 instead of the usual -O2.
I can see on godbolt.org that gcc-1.27 did not have that optimization
yet, while gcc-4.1 had it, but I haven't found any versions between
those. I vaguely remember us throwing out the version strings from
most kernel files a long time ago, possibly that was triggered by
gcc no longer putting them into the object any more, but I can't
find a reference for that.
What I can see is that a lot of old network drivers have version
strings like this one, but they are actually printed from the
probe function, and lost their __devinitdata annotation in the past.
Arnd