|
Boost : |
From: John Maddock (john_at_[hidden])
Date: 2007-08-25 11:32:37
Peter Dimov wrote:
> John Maddock:
>
>> Is the proposal here: http://svn.boost.org/trac/boost/ticket/1130 a
>> viable way of fixing the pesky gcc warnings from BOOST_WORKAROUND?
>
> It works for me.
That was my first thought, however, on reflection it looks fragile: with
this change BOOST_WORKAROUND when applied to an unknown pp-symbol will
always silently return 0, which isn't what we want to have happen :-(
What if we reverse the logic a little:
# define BOOST_WORKAROUND(symbol, test) \
(0 == (BOOST_WORKAROUND_GUARD_ ## symbol) && \
(symbol != 0) && (1 % (( (symbol test) ) + 1)))
Which (I hope!) has no change to current behaviour if
BOOST_WORKAROUND_GUARD_ ## symbol is not defined.
Then for common pp-symbols we add:
#define BOOST_WORKAROUND_GUARD_BOOST_MSVC !defined(BOOST_MSVC)
And hopefully the warnings get suppressed: at least in the common cases.
John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk