[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120427231452.21afc293.akpm@linux-foundation.org>
Date: Fri, 27 Apr 2012 23:14:52 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Konstantin Khlebnikov <khlebnikov@...nvz.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>
Subject: Re: [PATCH 4/4] bug: mark disabled BUG() as unreachable() code
On Sat, 28 Apr 2012 09:10:18 +0400 Konstantin Khlebnikov <khlebnikov@...nvz.org> wrote:
> Konstantin Khlebnikov wrote:
> > This patch suppress some compiler warnings (if CONFIG_BUG=n)
> > "warning: control reaches end of non-void function"
>
> With this patch gcc throw out loop at the end of do_exit():
>
> schedule();
> BUG();
> /* Avoid "noreturn function does return". */
> for (;;)
> cpu_relax(); /* For when BUG is null */
>
> Is this ok? Probably not, and we need here some BUG_NORETURN() which
> really never returns even if CONFIG_BUG=n.
Probably we should do away with CONFIG_BUG.
CONFIG_BUG=n causes various compile-time warnings to come out when the
execution proceeds into places where we didn't intend and these aren't
worth fixing.
More seriously, I rather doubt that anyone ever sets it to n. And it
would be a pretty dumb thing to do - if your kernel has seriously
malfunctioned and it *knows* that it malfunctioned, it will just
blunder on anyway not telling anyone about it.
It doesn't seem worth any effort to support this thing.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists