Re: Use of do...while(0) in ASSERT macro
From: Christian Bau (christian.bau_at_cbau.freeserve.co.uk)
Date: 11/20/03
- Previous message: Christian Bau: "Re: Use of do...while(0) in ASSERT macro"
- In reply to: Richard Heathfield: "Re: Use of do...while(0) in ASSERT macro"
- Next in thread: Richard Heathfield: "Re: Use of do...while(0) in ASSERT macro"
- Reply: Richard Heathfield: "Re: Use of do...while(0) in ASSERT macro"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Previous message: Christian Bau: "Re: Use of do...while(0) in ASSERT macro"
- In reply to: Richard Heathfield: "Re: Use of do...while(0) in ASSERT macro"
- Next in thread: Richard Heathfield: "Re: Use of do...while(0) in ASSERT macro"
- Reply: Richard Heathfield: "Re: Use of do...while(0) in ASSERT macro"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|