Re: [PATCH] BUILD_BUG_ON sucks

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Saturday, August 16, 2008 - 1:07 pm

On Sat, 16 Aug 2008, Rusty Russell wrote:

Agreed. I think Alexey's patch is broken.

The thing is, BUILD_BUG_ON() is a different thing. It says "this is a 
build error", while BUG_ON() says "this is an error if we reach it".

Very different.

The fact that you broke BUG_ON(1) should have made you think. Sometimes 
the "1" isn't necessarily a constant one. It might be

	if (something_that_can_never_happen_in_some_configuration) {
		...
		BUG_ON(CONFIG_XYZZY);
		...
	}

where the BUG_ON(1) is absolutely *not* the same thing as BUILD_BUG_ON().

			Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] BUILD_BUG_ON sucks, Alexey Dobriyan, (Sat Aug 16, 3:09 am)
Re: [PATCH] BUILD_BUG_ON sucks, Rusty Russell, (Sat Aug 16, 3:55 am)
Re: [PATCH] BUILD_BUG_ON sucks, Andrew Morton, (Sat Aug 16, 10:46 am)
Re: [PATCH] BUILD_BUG_ON sucks, Linus Torvalds, (Sat Aug 16, 1:07 pm)
Re: [PATCH] BUILD_BUG_ON sucks, Theodore Tso, (Sun Aug 17, 5:19 am)
Re: [PATCH] BUILD_BUG_ON sucks, Andrew Morton, (Sun Aug 17, 9:33 am)