Boost logo

Boost Users :

From: Dave Steffen (dgsteffen_at_[hidden])
Date: 2005-07-01 09:54:34


Hi Folks,

Having gotten a big delivery out the door, I can come back to the
issue.

First, let me thank all those who have taken the time to reply; I
appreciate your time and knowledge.

David Abrahams writes:

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

and several others agreed with him. Plus or minus Brian Allison's
comments on C++ grammar, it sounds like we need to get rid of them;
which is to say, the correct thing to do is _not_ turn off GCC's
warnings, but to believe them and fix our code. I suspected this was
the case (we usually trust GCC), but wasn't sure; we are doing some
'odd' things with macros (odd to anybody who hasn't seen what Boost's
preprocessor metaprogramming library is up to ;-) that might trigger a
nervous compiler to emit warnings.

David Abrahams continued:

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

Most of us live on Emacs; I was hoping to get away with not mucking
about with the indentation rules (Emacs tends to indent things 'the
way I like them' when there are semicolons in certain places). This
is, of course, an annoyance, not a fundamental issue. :-)

me22 wrote:

> How about adding a superfluous struct at the end of the function?

> #define f(T) void my_func(T i) { do_sthg(); } struct semicolon_eater {}

I haven't tried this yet, but it's the sort of thing I was fishing
for. If the language says semicolons are illegal in certain places,
but I want semicolons there (maybe for good reasons, maybe "just
because, dammit!"), is there a clever construct that will let me get
away with it?

I'm gonna go try this (or something like it) soon, will report back.
The advisability of doing this sort of thing is, perhaps, debatable;
one of the reasons I wanted to push to GCC 3.4 is precisely this sort
of thing: what are we doing that we shouldn't be?

Thanks again.

----------------------------------------------------------------------
Dave Steffen, Ph.D. "There are two ways to write error-free
Software Engineer IV programs; only the third one works."
Numerica Corporation
ph (970) 419-8343 x27 "Pie are not square. Pie are round.
fax (970) 223-6797 Cornbread are square"
dgsteffen_at_[hidden] ... anon (usenet)
___________________
Numerica Disclaimer:
This message and any attachments are intended only for the individual
or entity to which the message is addressed. It is proprietary and
may contain privileged information. If you are neither the intended
recipient nor the agent responsible for delivering the message to the
intended recipient, you are hereby notified that any review,
retransmission, dissemination, or taking of any action in reliance
upon, the information in this communication is strictly prohibited,
and may be unlawful. If you feel you have received this communication
in error, please notify us immediately by returning this Email to the
sender and deleting it from your computer.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net