From owner-freebsd-hackers Fri Jun 5 11:38:36 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA16945 for freebsd-hackers-outgoing; Fri, 5 Jun 1998 11:38:36 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from swing.ca.sandia.gov (swing.ca.sandia.gov [146.246.246.5]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA16825 for ; Fri, 5 Jun 1998 11:38:12 -0700 (PDT) (envelope-from cc@swing.ca.sandia.gov) Received: from swing.ca.sandia.gov (localhost [127.0.0.1]) by swing.ca.sandia.gov (8.8.8/8.8.8) with ESMTP id GAA02086; Fri, 5 Jun 1998 06:38:04 -0500 (CDT) (envelope-from cc@swing.ca.sandia.gov) Message-Id: <199806051138.GAA02086@swing.ca.sandia.gov> X-Mailer: exmh version 2.0.2 2/24/98 To: Marino Ladavac cc: Greg Lehey , freebsd-hackers@FreeBSD.ORG Subject: Re: style(9) error? In-reply-to: Your message of "Fri, 05 Jun 1998 11:26:17 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 05 Jun 1998 06:38:04 -0500 From: "Chris Csanady" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [...] >>> As far as I can tell, it is impossible to put a do loop in a if statement, >>> or anything else. Is this correct? >> >> No. > >We have a case of misunderstanding here: the original poster asked whether > > if (MACRO(x, y)) > foo(); > else > bar(); Thank you.. This is indeed what I was thinking, and how I read the man page. I actually did some further looking, and it seems that it is possble to do this, only using something slightly different. #define BLA(x) ({ (x); }) This actually works in a conditional, assignment, etc.. evaluating the block to the last statement as I was expecting. Is there a reason why the do {} while(0) would be preffered over this? I appologize for the misunderstanding, I really didn't mean to make such a big deal over this nuance of C. Chris To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message