lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 16 Aug 2008 13:07:51 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Rusty Russell <rusty@...tcorp.com.au>
cc:	Alexey Dobriyan <adobriyan@...il.com>,
	torvalds@...uxfoundation.org, akpm@...uxfoundation.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] BUILD_BUG_ON sucks



On Sat, 16 Aug 2008, Rusty Russell wrote:
> 
> Interesting idea, but I've come to actually like the semantic explicitness of 
> BUILD_BUG_ON.  There's a difference between "we should never get here" 
> and "this should never exist".

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ