Messages in this thread | | | From | Rusty Russell <> | Subject | Re: [PATCH 5/5 ver2] debug: BUILD_BUG_ON: error on non-const expressions | Date | Thu, 2 Oct 2008 15:35:35 +1000 |
| |
On Wednesday 03 September 2008 01:57:31 Boaz Harrosh wrote: > +#define BUILD_BUG_ON(e) \ > + do { struct {int:-!!(e); } x __maybe_unused;} while(0)
Why did you hate the void cast again? Simplest should be "(void)BUILD_BUG_ON_ZERO(e)". But if not, it seems to me that it's cleaner to do:
#define BUILD_BUG_ON(e) \ do { } while(BUILD_BUG_ON_ZERO(e))
No chance of the compiler emitting unused vars.
Cheers, Rusty.
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |