From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754190AbYJCBbu (ORCPT ); Thu, 2 Oct 2008 21:31:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754422AbYJCBbU (ORCPT ); Thu, 2 Oct 2008 21:31:20 -0400 Received: from ozlabs.org ([203.10.76.45]:60470 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754344AbYJCBbT convert rfc822-to-8bit (ORCPT ); Thu, 2 Oct 2008 21:31:19 -0400 From: Rusty Russell To: Boaz Harrosh Subject: Re: [PATCH 5/5 ver2] debug: BUILD_BUG_ON: error on non-const expressions Date: Thu, 2 Oct 2008 15:35:35 +1000 User-Agent: KMail/1.9.9 Cc: Ingo Molnar , "David S. Miller" , Ivo van Doorn , "John W. Linville" , Alexey Dobriyan , Andrew Morton , Theodore Tso , Linus Torvalds , Jan Beulich , linux-kernel References: <48BBE77D.7070007@panasas.com> <48BBEE04.30903@panasas.com> <48BD626B.6070705@panasas.com> In-Reply-To: <48BD626B.6070705@panasas.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT Content-Disposition: inline Message-Id: <200810021535.36302.rusty@rustcorp.com.au> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.