|
Boost : |
From: Paul A Bristow (pbristow_at_[hidden])
Date: 2006-09-29 13:01:24
| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of SourceForge.net
| Sent: 29 September 2006 16:22
| To: noreply_at_[hidden]
| Subject: [boost] [Boost-bugs] [ boost-Bugs-1567815 ]
| Excessive warnings onMSVC
|
| Bugs item #1567815, was opened at 2006-09-29 11:21
| Message generated for change (Tracker Item Submitted) made
| by Item Submitter
| You can respond by visiting:
| https://sourceforge.net/tracker/?func=detail&atid=107586&aid=
| 1567815&group_id=7586
|
| Please note that this message will contain a full copy of
| the comment thread,
| including the initial issue submission, for this request,
| not just the latest update.
| Category: function
| Group: None
| Status: Open
| Resolution: None
| Priority: 5
| Submitted By: Douglas Gregor (dgregor)
| Assigned to: Douglas Gregor (dgregor)
| Summary: Excessive warnings on MSVC
|
| Initial Comment:
| I'm getting a large number of C4127, "conditional expression
| is constant",
| warnings from function_template.hpp:141. Can we do something about
| these?
We can and should - and I am setting a good example adding them to John
Maddock's
<plug>
upcoming for preview "Math functions and Statistical Distributions".
<\plug>
So they should all compile cleanly with the 'strictest' compiler options.
At very least, putting near the start but AFTER other #include <boost/....>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4127) // conditional expression is constant.
... and, if appropriate, others like
# pragma warning(disable: 4189) // local variable is initialized but not
referenced.
#endif
and at the end
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#endif //BOOST_???_HPP
But I note that using the normally recommended
#ifdef BOOST_MSVC
can fail to have the desired effect unless it is preceeded by an (probably
implicit) include of Boost config that will set the macro from _MSC_VER.
This is not normally a problem with Boost headers.
Paul
--- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk