|
Boost : |
Subject: Re: [boost] Compiler Warnings Tests
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-11-30 08:48:35
Paul A. Bristow wrote:
> Stewart, Robert wrote:
> >
> > It might be possible to wrap the code that is supposed to
> > warn with a macro that dictates the expected behavior:
> >
> > BOOST_MUST_WARN(short a1(b + c));
>
> Either looks plausible, but I would just remind you that
> there are only about 20
> code constructs where warnings that seem to cause trouble, so
> are you sure we are not making a mountain out of a molehill?
>
> If either or both produce a working example for just one type
> of warning, I'll
> do the grunt work in setting up the test for all (20 of) the
> rest - for my
> sins, since I moaned too much about warnings in the first place ;-)
You're probably right. At the least, having a standard mechanism for producing a failure when a compiler isn't expected to warn is probably desirable. Perhaps that should be captured in a reusable macro: BOOST_SYNTHESIZE_WARNING or something. Then you can use the simpler conditional compilation and avoid the extra work to create a suitable BOOST_MUST_WARN for each test. I don't think the latter is complicated, but I do wonder if we'll find it hard to insert all necessary code in the macro invocation for all cases. IOW, it is probably better to follow the conditional compilation with BOOST_SYNTHESIZE_WARNING approach.
_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk