[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patch] CVS-Guile compilation problems

From: Marius Vollmer
Subject: Re: [Patch] CVS-Guile compilation problems
Date: 15 Feb 2001 21:30:22 +0100
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7

Matthias Koeppe <address@hidden> writes:

> Marius Vollmer <address@hidden> writes:
> > Would it suffice to just use this?
> > 
> >     next_symbol:
> >       ;
> >     }
> > 
> > "(void)0" looks strange.
> I don't think that a singleton ";" is a C statement.

My rusty and trusty Kernighan and Ritchy says that it is (Appendix A,
18.3).  I would be surprised if they later changed that.

> That's why one has to write `do { ... } while (0)' in all these
> preprocessor macros -- just to avoid a singleton ";".

No, I think the reason for this is that you can't safely use a
compound statement as the expansion of a macro whose invocation is
supposed to be syntactically indistinguishable from a function call

For example, this will break

    if (...)
      foo ();
      bar ();

when foo is macro defined as

    #define foo() { int i; for(i=0;i<5;i++) baz(i); }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]