Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2005-06-30 07:30:29

Dave Steffen <dgsteffen_at_[hidden]> writes:

> I claim that our macros and use thereof is A) correct and B) safe.
> It just so happens that these macro constructs occasionally expand to
> something that has an extra semicolon, which triggers a warning in
> GCC 3.4 that we haven't seen before.

The warning will be an error on other compilers. The semicolons
aren't just "bad style;" they're illegal.

> What I'm asking is this: assuming that our macros and useage
> thereof is correct,

Well, it's not correct if you expect those semicolons to be usable
after them.

> how do we
> A) silence the GCC warning about extra semicolons, or

I wouldn't count on there being a way.

> B) modify the construct so that the trailing semicolon is
> "legal", or at least "something that won't scare the
> compiler".

I suggest you use Emacs or some other programmable editor and teach
its indentation mode about your macros if automatic indentation is
that important.

Dave Abrahams
Boost Consulting

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at