Messages in this thread | | | From | Rusty Russell <> | Subject | Re: [PATCH] debug: fix BUILD_BUG_ON() for non-constant expressions | Date | Mon, 25 Aug 2008 11:19:09 +1000 |
| |
On Wednesday 20 August 2008 02:33:59 Boaz Harrosh wrote: > If the user of virtio_has_feature() must pass a compile-time constant then > it must be converted to a MACRO, and then the BUILD_BUG_ON will work. > Or it should be changed to a BUG_ON() if fbit is a runtime variable.
I was (ab)using the current slackness of BUILD_BUG_ON() to be a noop on non-constants. We can replace with a BUG_ON if we fix BUILD_BUG_ON() to insist on a compile-time constant; I think that's still an overall win.
Cheers, Rusty.
| |