2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00

Fix warning C4555: result of expression not used

This commit is contained in:
Nikita Kniazev
2021-12-16 00:54:22 +03:00
parent 2a231e81a3
commit 5026daaf17
11 changed files with 16 additions and 15 deletions

View File

@@ -26,6 +26,7 @@ project spirit
<warnings>extra,<toolset>clang-linux:<cxxflags>-Wshadow-field-in-constructor
<warnings>extra,<toolset>clang-linux:<cxxflags>-Wshadow-uncaptured-local
<warnings>extra,<toolset>clang-linux:<cxxflags>-Wundefined-reinterpret-cast
<warnings>extra,<toolset>msvc:<cxxflags>-w44555 # result of expression not used
# Broken or very high false-positive rate
<known-warnings>hide,<toolset>gcc:<cxxflags>-Wno-maybe-uninitialized # Too many pesky false-positives

View File

@@ -55,7 +55,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
, Delimiter const& d, unused_type, bool&)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
// return true if any of the generators succeed
return component.generate(sink, ctx, d, unused);
@@ -87,7 +87,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
, Context& ctx, Delimiter const& d, Attribute const& attr, bool&)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
return call(component, sink, ctx, d, attr
, spirit::traits::not_is_variant_or_variant_in_optional<Attribute, karma::domain>());
@@ -99,7 +99,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
, Context& ctx, Delimiter const& d, Attribute const& attr, mpl::true_)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
return component.generate(sink, ctx, d, attr);
}
@@ -110,7 +110,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
, Context& ctx, Delimiter const& d, Attribute const& attr, mpl::false_)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
typedef
traits::compute_compatible_component<Expected, Attribute, domain>

View File

@@ -30,7 +30,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
bool operator()(Component const& component, Attribute const& attr) const
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
// return true if any of the generators fail
return !component.generate(sink, ctx, delim, attr);
@@ -40,7 +40,7 @@ namespace boost { namespace spirit { namespace karma { namespace detail
bool operator()(Component const& component) const
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
// return true if any of the generators fail
return !component.generate(sink, ctx, delim, unused);

View File

@@ -93,7 +93,7 @@ namespace boost { namespace spirit { namespace karma
unsigned int const width, Padding const& p)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
(void)e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
#endif
// wrap the given output iterator to allow left padding
detail::enable_buffering<OutputIterator> buffering(sink, width);

View File

@@ -93,7 +93,7 @@ namespace boost { namespace spirit { namespace karma
unsigned int const width, Padding const& p)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
(void)e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
#endif
// wrap the given output iterator to allow counting
detail::enable_counting<OutputIterator> counting(sink);

View File

@@ -105,7 +105,7 @@ namespace boost { namespace spirit { namespace karma
unsigned int const maxwidth, Rest& restdest)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
(void)e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
#endif
// wrap the given output iterator to allow buffering, but disable
// counting

View File

@@ -93,7 +93,7 @@ namespace boost { namespace spirit { namespace karma
unsigned int const width, Padding const& p)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
(void)e; // suppresses warning: C4100: 'e' : unreferenced formal parameter
#endif
// wrap the given output iterator to allow left padding
detail::enable_buffering<OutputIterator> buffering(sink, width);

View File

@@ -40,7 +40,7 @@ namespace boost { namespace spirit { namespace karma
call (OutputIterator& sink, U b, Policies const& p = Policies())
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
p; // suppresses warning: C4100: 'p' : unreferenced formal parameter
(void)p; // suppresses warning: C4100: 'p' : unreferenced formal parameter
#endif
return p.template call<bool_inserter>(sink, T(b), p);
}
@@ -53,7 +53,7 @@ namespace boost { namespace spirit { namespace karma
call_n (OutputIterator& sink, U b, Policies const& p)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
p; // suppresses warning: C4100: 'p' : unreferenced formal parameter
(void)p; // suppresses warning: C4100: 'p' : unreferenced formal parameter
#endif
if (b)
return p.template generate_true<CharEncoding, Tag>(sink, b);

View File

@@ -128,7 +128,7 @@ namespace boost { namespace spirit { namespace qi
return false;
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
p; // suppresses warning: C4100: 'p' : unreferenced formal parameter
(void)p; // suppresses warning: C4100: 'p' : unreferenced formal parameter
#endif
return (allow_true && p.parse_true(first, last, attr)) ||
(!disallow_false && p.parse_false(first, last, attr));

View File

@@ -137,7 +137,7 @@ namespace boost { namespace spirit { namespace qi
, str_hi(in)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
encoding; // suppresses warning: C4100: 'encoding' : unreferenced formal parameter
(void)encoding; // suppresses warning: C4100: 'encoding' : unreferenced formal parameter
#endif
typename string_type::iterator loi = str_lo.begin();
typename string_type::iterator hii = str_hi.begin();

View File

@@ -30,7 +30,7 @@ namespace boost { namespace spirit { namespace detail
void operator()(Component const& component) const
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
(void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
boost::get<std::list<info> >(what.value).
push_back(component.what(context));