Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jun 1998 14:24:29 -0700 (PDT)
From:      Archie Cobbs <archie@whistle.com>
To:        cc@swing.ca.sandia.gov (Chris Csanady)
Cc:        lada@pc8811.gud.siemens.at, grog@lemis.com, freebsd-hackers@FreeBSD.ORG
Subject:   Re: style(9) error?
Message-ID:  <199806052124.OAA02209@bubba.whistle.com>
In-Reply-To: <199806051138.GAA02086@swing.ca.sandia.gov> from Chris Csanady at "Jun 5, 98 06:38:04 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Chris Csanady writes:
> 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 believe that your definition only works because it's a gcc extra feature.
The do {} while (0) method is ANSI compatible.

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806052124.OAA02209>