[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patches #219 - #224
From: |
Pavel Machek |
Subject: |
Re: Patches #219 - #224 |
Date: |
Thu, 11 Apr 2002 16:54:25 +0200 |
User-agent: |
Mutt/1.3.28i |
Hi!
> > > > #224:
> > > > +# define dump while(0)
> > > > +# define dprintf while(0)
> > > >
> > > > Are you sure that syntax is correct?
> > >
> > > According to me and a co-worker that used to be in compiler design, yes
> it
> > > is.
> > >
> > > What happens:
> > > dprintf( "some format string: %s %d\n", s, n );
> > > gets translated to:
> > > while(0);
> >
> > AFAICS it will translate to
> >
> > while(0)( "some format string" );
> >
> > That can't be right...
>
> Both me and that co-worker overlooked the exact meaning of the argument(s)
> substitution, call it stupid. :-(
Actually, it is okay.
It's equivalent to
while(0) { "some format string" };
which is correct, but seriously strange C.
Pavel
--
(about SSSCA) "I don't say this lightly. However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa