From owner-freebsd-hackers Thu Jun 4 21:22:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA23175 for freebsd-hackers-outgoing; Thu, 4 Jun 1998 21:22:28 -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 VAA23141 for ; Thu, 4 Jun 1998 21:22:14 -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 QAA00625 for ; Thu, 4 Jun 1998 16:22:23 -0500 (CDT) (envelope-from cc@swing.ca.sandia.gov) Message-Id: <199806042122.QAA00625@swing.ca.sandia.gov> To: freebsd-hackers@FreeBSD.ORG Subject: style(9) error? Date: Thu, 04 Jun 1998 16:22:22 -0500 From: "Chris Csanady" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I would like to make use of a feature that style tells me I can use, but gcc tells me I can not.. >From style(9): es, it makes it easier to read. If the macro encapsulates a compound statement, enclose it in a ``do'' loop, so that it can safely be used in ``if'' statements. Any final statement-terminating semicolon should be supplied by the macro invocation rather than the macro, to make parsing easier for pretty-printers and editors. #define MACRO(x, y) do { \ variable = (x) + (y); \ (y) += 2; \ } while(0) As far as I can tell, it is impossible to put a do loop in a if statement, or anything else. Is this correct? I always thought that blocks evaluated to their last statements, but it seems not.. Chris Csanady To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message