Re: Build regressions/improvements in v3.17-rc6 (take two)

From: Geert Uytterhoeven
Date: Tue Sep 23 2014 - 06:23:09 EST


On Tue, Sep 23, 2014 at 12:09 PM, Chuck Ebbert <cebbert.lkml@xxxxxxxxx> wrote:
> On Tue, 23 Sep 2014 10:31:20 +0200
> Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
>
>> + /scratch/kisskb/src/mm/memcontrol.c: warning: control reaches end of non-void function [-Wreturn-type]: => 4164:1
>
> Well, this one was educational. It was caused by:
>
> commit 05b8430123359886ef6a4146fba384e30d771b3f
> Author: Johannes Weiner <hannes@xxxxxxxxxxx>
> Date: Wed Aug 6 16:05:59 2014 -0700
>
> mm: memcontrol: use root_mem_cgroup res_counter
>
> This removed the return statement from mem_cgroup_read_u64(). I think
> Johannes was assuming that BUG() never returns, but it looks like that
> is not true on some archs, especially with CONFIG_BUG disabled. (On x86
> it never returns in any case.) The bug was always there - it would have
> just returned an uninitialized variable before. Now it returns some
> different random value.
>
> I'm not sure what to do here. I really think BUG() should never return
> no matter what options are configured. In this case it's no big deal
> and I'd just return zero to silence the warning, but a bigger problem
> is that there are probably other places assuming BUG() never
> returns?

Just ignore it for now.

Fixing BUG() to avoid this has been an ongoing project for several years.
I don't remember what the latest status is...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/