From owner-freebsd-current@FreeBSD.ORG Mon Jun 15 18:38:34 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F7C210656A8 for ; Mon, 15 Jun 2009 18:38:34 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 657468FC23 for ; Mon, 15 Jun 2009 18:38:34 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n5FIcXZo064967 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 15 Jun 2009 11:38:34 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4A369529.5090004@freebsd.org> Date: Mon, 15 Jun 2009 11:38:33 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.21 (X11/20090411) MIME-Version: 1.0 To: Roman Divacky References: <20090615181555.GA52009@freebsd.org> In-Reply-To: <20090615181555.GA52009@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-Misty-Metrics: ebb.errno.com; whitelist Cc: current@freebsd.org Subject: Re: [RFC]: (void)0 instead of empty defines X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 18:38:35 -0000 Roman Divacky wrote: > hi > > in many places we do something like > > #ifdef SOMETHING > #define FOO some_code > #else > #define FOO > #endif > > > I propose to change the second FOO to (void)0 in many places to > > 1) let this compile cleanly with clang. Clang warns in many places > about > if (cond) > FOO; > > which has empty if body > > 2) enforces ; at the end of the expression > > this does not cost us nothing so I hope this change is ok. > > patch at: http://www.vlakno.cz/~rdivacky/void-zero.patch > > what do you think? > > roman > > p.s. there's also ACPI_DEBUG_PRINT in contrib/acpica which I hope > jkim might handle > Are you saying that: if (cond) ; is considered worthy of a warning by the compiler? Is it just "if" or all conditional control constructs (e.g. while)? I can image many instances of this construct arising from debugging facilities. This sounds like a stupid restriction and I would argue we should just disable the warning. Sam