On Mon, 07 Jul 2003, Robert Collins wrote:
> Interestingly though, my testcases (in test-suite/debug.cc in the
> branch) use a trailing semicolon quite happily.

The extra trailing semicolon is seen by the compiler as a null
statement.  It's usually harmless, but can cause trouble sometimes.  Try
this:

        if (something)
                debugs(x,y)("foo");
        else
                debugs(x,y)("bar");

and I think you'll get an error in the "foo" line with your original
macros, but not with the "do { ... } while (0)" version.

--apb (Alan Barrett)

Reply via email to