From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 30 19:11:46 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 DDE8A106564A for ; Sun, 30 Jan 2011 19:11:46 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6E8C98FC17 for ; Sun, 30 Jan 2011 19:11:45 +0000 (UTC) Received: by fxm16 with SMTP id 16so5166347fxm.13 for ; Sun, 30 Jan 2011 11:11:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:x-mailer:mime-version:content-type :content-transfer-encoding; bh=FD959gPTmp43jeCHligZyT3fitB0xVGk5gpa09qKOyQ=; b=pBRrhj70aQAZpYnrXknJ7AdG8JB/MbBHtO4wyoaTnEVUF+8NpuXfP859cZanFJP+id 86efoKVLKAUXGEyyR4Oud6dwYlvWTVvKiauleCWNMImryIBbTviFJrZNUA9yeYIkmdBX 1ZaKGTWggyJvSE6XsL411XYvg2JV2MoRXPNeE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=IibphcUfCNYqZ+UDr70uaBP4GFhHZKK8MXt+X1ggMbdD1opvxN2meUNzDVotvoDxqH 1iFTNrgdeXIOL5vA26eMpbOf+UkueELhIkRWA6Adx+L1fmm4IQYrxzJ55vEHIeT5o0p9 K+ACziNUCZXFoe27zi0QVNAiIK7BreTmNF//o= Received: by 10.223.71.199 with SMTP id i7mr5286586faj.57.1296414704781; Sun, 30 Jan 2011 11:11:44 -0800 (PST) Received: from ernst.jennejohn.org (p578E1A47.dip.t-dialin.net [87.142.26.71]) by mx.google.com with ESMTPS id o17sm7087997fal.25.2011.01.30.11.11.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 30 Jan 2011 11:11:44 -0800 (PST) Date: Sun, 30 Jan 2011 20:11:42 +0100 From: Gary Jennejohn To: Alexander Best Message-ID: <20110130201142.09f4b998@ernst.jennejohn.org> In-Reply-To: <20110130172941.GA10701@freebsd.org> References: <20110130172941.GA10701@freebsd.org> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: empty function macros X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jan 2011 19:11:46 -0000 On Sun, 30 Jan 2011 17:29:41 +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) > > 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) > What happens if you treat it like a real function call and put ';' after it? -- Gary Jennejohn (gj@)