Re: macros: "do-while" versus "({ })" and a compile-time error

2007-01-10 Thread Andreas Schwab
"J.A. Magallón" <[EMAIL PROTECTED]> writes: > {} is a compund command and ({ }) is a compund expression > (or block expression, do not know which is the good name in engelish). gcc calls it a statement expression. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products Gmb

Re: macros: "do-while" versus "({ })" and a compile-time error

2007-01-10 Thread J.A. Magallón
On Wed, 10 Jan 2007 07:16:55 -0500, "linux-os \(Dick Johnson\)" <[EMAIL PROTECTED]> wrote: > > On Wed, 10 Jan 2007, Robert P. J. Day wrote: > > > On Tue, 9 Jan 2007, linux-os (Dick Johnson) wrote: > > > >> > >> On Tue, 9 Jan 2007, Stefan Richter wrote: > >> > >>> Robert P. J. Day wrote: >

Re: macros: "do-while" versus "({ })" and a compile-time error

2007-01-10 Thread Stefan Richter
Robert P. J. Day wrote: [...] > what the above implies is > that the ALIGN() macro can *never* be extended in that way because of > the way it's being used in the struct definition above, outside of a > function. > > doesn't that place an unnecessarily limit on what might be done with > ALIGN() in

Re: macros: "do-while" versus "({ })" and a compile-time error

2007-01-10 Thread linux-os \(Dick Johnson\)
On Wed, 10 Jan 2007, Robert P. J. Day wrote: > On Wed, 10 Jan 2007, linux-os (Dick Johnson) wrote: > >> >> On Wed, 10 Jan 2007, Robert P. J. Day wrote: > >>> just FYI, the reason i brought this up in the first place is that >>> i noticed that the ALIGN() macro in kernel.h didn't verify that >>> t

Re: macros: "do-while" versus "({ })" and a compile-time error

2007-01-10 Thread Robert P. J. Day
On Wed, 10 Jan 2007, linux-os (Dick Johnson) wrote: > > On Wed, 10 Jan 2007, Robert P. J. Day wrote: > > just FYI, the reason i brought this up in the first place is that > > i noticed that the ALIGN() macro in kernel.h didn't verify that > > the alignment value was a power of 2, so i thought --

Re: macros: "do-while" versus "({ })" and a compile-time error

2007-01-10 Thread linux-os \(Dick Johnson\)
On Wed, 10 Jan 2007, Robert P. J. Day wrote: > On Tue, 9 Jan 2007, linux-os (Dick Johnson) wrote: > >> >> On Tue, 9 Jan 2007, Stefan Richter wrote: >> >>> Robert P. J. Day wrote: just to stir the pot a bit regarding the discussion of the two different ways to define macros, >>> >>> Yo

Re: macros: "do-while" versus "({ })" and a compile-time error

2007-01-09 Thread Robert P. J. Day
On Tue, 9 Jan 2007, linux-os (Dick Johnson) wrote: > > On Tue, 9 Jan 2007, Stefan Richter wrote: > > > Robert P. J. Day wrote: > >> just to stir the pot a bit regarding the discussion of the two > >> different ways to define macros, > > > > You mean function-like macros, right? > > > >> i've jus

Re: macros: "do-while" versus "({ })" and a compile-time error

2007-01-09 Thread Stefan Richter
linux-os (Dick Johnson) wrote: > On Tue, 9 Jan 2007, Stefan Richter wrote: >> The limitations are certainly highly compiler-specific. > > I don't think so. I referred to the ({ expr; }) in this remark, not to do-while. It's not a valid construct in many flavors of the C language in the first plac

Re: macros: "do-while" versus "({ })" and a compile-time error

2007-01-09 Thread linux-os \(Dick Johnson\)
On Tue, 9 Jan 2007, Stefan Richter wrote: > Robert P. J. Day wrote: >> just to stir the pot a bit regarding the discussion of the two >> different ways to define macros, > > You mean function-like macros, right? > >> i've just noticed that the "({ })" >> notation is not universally acceptable.

Re: macros: "do-while" versus "({ })" and a compile-time error

2007-01-09 Thread Stefan Richter
Robert P. J. Day wrote: > just to stir the pot a bit regarding the discussion of the two > different ways to define macros, You mean function-like macros, right? > i've just noticed that the "({ })" > notation is not universally acceptable. i've seen examples where > using that notation causes

Re: macros: "do-while" versus "({ })" and a compile-time error

2007-01-09 Thread H. Peter Anvin
Robert P. J. Day wrote: just to stir the pot a bit regarding the discussion of the two different ways to define macros, i've just noticed that the "({ })" notation is not universally acceptable. i've seen examples where using that notation causes gcc to produce: error: braced-group within e

macros: "do-while" versus "({ })" and a compile-time error

2007-01-08 Thread Robert P. J. Day
just to stir the pot a bit regarding the discussion of the two different ways to define macros, i've just noticed that the "({ })" notation is not universally acceptable. i've seen examples where using that notation causes gcc to produce: error: braced-group within expression allowed only in