Re: Use of do...while(0) in ASSERT macro

From: Christian Bau (christian.bau_at_cbau.freeserve.co.uk)
Date: 11/20/03

  • Next message: Chris Torek: "Re: Pointing to high and low bytes of something"
    Date: Thu, 20 Nov 2003 00:55:37 +0000
    
    

    In article <bpgk17$2pf$4@sparta.btinternet.com>,
     Richard Heathfield <dontmail@address.co.uk.invalid> wrote:

    > Christopher Benson-Manica wrote:
    >
    > > Richard Heathfield <dontmail@address.co.uk.invalid> spoke thus:
    > >
    > >> ...works just fine without the do/while(0) silliness.
    > >
    > > Does that mean that the do/while(0) bit is merely an obfuscating
    > > device?
    >
    > If you write:
    >
    > if(foo)
    > bar();
    >
    > then no, it is not.
    >
    > If you write:
    >
    > if(foo)
    > {
    > bar();
    > }
    >
    > then yes, it is.

    If you think that removing the braces in

    > if(foo)
    > {
    > bar();
    > }

    shouldn't cause any problems, then it isn't.


  • Next message: Chris Torek: "Re: Pointing to high and low bytes of something"

    Relevant Pages

    • Re: inline vs macro
      ... Richard Heathfield wrote: ... Superior in every way that I can imagine. ... At the end, biggest is 4, bar is 4, and ... the writer wants bar, and biggest, to be 3 rather than 4. ...
      (comp.lang.c)
    • Re: Code breaker puzzle game
      ... Richard Heathfield wrote: ... The instructions say, in part: ... which doesn't have an address bar. ... Yes, of course I know how to correct for that, but it's just an indication that this site hasn't been thought through very well. ...
      (rec.puzzles)
    • Re: Code breaker puzzle game
      ... The instructions say, in part: ... "Go to your address bar and change that bit to /level1 so that the url now ... reads http://theresaknott.googlepages.com/level1 and hit return." ... Richard Heathfield ...
      (rec.puzzles)
    • Re: // vs /*
      ... Richard Heathfield wrote: ... Win32 platforms, to do this: ... Eww... ... But, you are correct, and the call to bar() disappears inside the ...
      (comp.lang.c)
    • Re: Use of do...while(0) in ASSERT macro
      ... Richard Heathfield wrote: ... > Christian Bau wrote: ... >> If you think that removing the braces in ...
      (comp.lang.c)