From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 31 08:56:21 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DF161065670; Mon, 31 Jan 2011 08:56:21 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 008A98FC13; Mon, 31 Jan 2011 08:56:20 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p0V8N6E8040556 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 31 Jan 2011 00:23:07 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4D46716E.6070500@freebsd.org> Date: Mon, 31 Jan 2011 00:23:10 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Roman Divacky References: <20110130172941.GA10701@freebsd.org> <20110131075439.GA49765@freebsd.org> In-Reply-To: <20110131075439.GA49765@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alexander Best , freebsd-hackers@freebsd.org Subject: Re: empty function macros X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2011 08:56:21 -0000 On 1/30/11 11:54 PM, Roman Divacky wrote: > no problem with this with clang :) > > On Sun, Jan 30, 2011 at 05:29:41PM +0000, Alexander Best wrote: >> hi there, >> >> i noticed freebsd has a few of the following macros: >> >> #define FUNC(sb) >> >> when you do something like >> >> if (cond) >> FUNC(i) you missed an important part.... it's probably if (cond) FUNC(i); (note the ';') THAT would be ok.... without the ';' you just made whatever comes next conditional. >> the compiler complains about an if statement with an empty body. any sensible >> way of dealing with this issue? >> >> i saw some reiserfs code which does the following to silence compilers: >> >> #define FUNC(sb) do { } while (0) yeah we do that too in some places. (certainly at work I have done so) >> cheers. >> alex >> >> -- >> a13x >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >