Re: [PATCH] x86, vsyscall: Fix build warning in vsyscall_64.c

From: Linus Torvalds
Date: Tue Jun 14 2011 - 17:24:58 EST


On Tue, Jun 14, 2011 at 2:16 PM, Ingo Molnar <mingo@xxxxxxx> wrote:
>
> I think correctness trumps code size and turning BUG() and BUG_ON()
> into a NOP is just crazy ...

Umm. It's even CRAZIER to turn it into a "compiler generates random code".

Which is what "unreachable()" ends up doing (different compilers will
generate different things - ranging from an infinite loop, to a "nop
with random behavior after it because gcc decided that it doesn't need
to pop arguments off the stack and just runs into random code
instead").

So a NOP is a *hell* of a lot better than turning BUG_ON() into
something random.

The only (and I mean *only*) valid use-case for unreachable() is after
an inline asm that really causes the next instruction to be
unreachable(), but the compiler just doesn't understand it. It is
*not* valid for that kind of crazy "if (condition) do-random-thing"
crap.

Seriously. If you want a "do random thing" thing, don't call it
BUG_ON(). Call it "I_M_A_FUCKING_MORON()".

There is no way I will ever accept a moronic patch like that.

Really.

Linus
--
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/