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:	Tue, 05 Jan 2010 17:58:18 +0000
From:	David Howells <dhowells@...hat.com>
To:	Sam Ravnborg <sam@...nborg.org>
Cc:	dhowells@...hat.com, Alexander Beregalov <a.beregalov@...il.com>,
	arnd@...db.de, linux-kernel@...r.kernel.org,
	David Miller <davem@...emloft.net>
Subject: Re: [PATCH] BUG(): CONFIG_BUG=n version of BUG() should be unreachable()

Sam Ravnborg <sam@...nborg.org> wrote:

> +#define BUG() do {							\
> +		for (;;)						\
> +			/* endless loop*/;				\
> +		unreachable();						\
> +} while(0)

Can you not do:

	#define BUG() do {						\
			unreachable();					\
	} while(1)

instead?  If the compiler is interpreting unreachable() to really mean that
what comes after will not be reached, then the condition/loop at the end of
the block should be optimised away.

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