[Boost-bugs] [Boost C++ Libraries] #8992: A bouquet of implicit conversion compiler warnings

Subject: [Boost-bugs] [Boost C++ Libraries] #8992: A bouquet of implicit conversion compiler warnings
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-08-13 09:42:01


#8992: A bouquet of implicit conversion compiler warnings
------------------------------------+--------------------------
 Reporter: Jan Bouwer <JBouwer@…> | Owner: rogeeff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost 1.54.0 | Severity: Optimization
 Keywords: |
------------------------------------+--------------------------
 The following (trivial?) warnings were kindly highlighted by clang
 ^([#version version])^ - using diagnostic options as indicated in the
 [...].
 I based these on the 1.54.0 release, as svn rev. 85329 did not compile for
 me at the time.
 File locations are in the format path:line:byte-column.

 * boost/test/impl/framework.ipp:438:21
         **warning: implicit conversion changes signedness**: 'int' to
 'unsigned int' [-Wsign-conversion]
         {{{
         std::srand( runtime_config::random_seed() );
         ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         }}}

 * boost/test/impl/exception_safety.ipp:404:46
         **warning: implicit conversion changes signedness**: 'unsigned
 int' to 'int' [-Wsign-conversion]
         {{{
         formatter << std::left << std::setw( indent ) << "";
                                   ~~~ ^~~~~~
     }}}

 * boost/test/impl/execution_monitor.ipp:249:72
         **warning: implicit conversion changes signedness**: 'typename
 error_info<throw_line_, int>::value_type' (aka 'int') to 'size_t' (aka
 'unsigned long') [-Wsign-conversion]
         {{{
 extract<throw_line>( be ),
 ^~~~~~~~~~~~~~~~~~~~~~~~~
     }}}

 * boost/test/impl/execution_monitor.ipp:761:18
         **warning: implicit conversion changes signedness**: 'int' to
 'unsigned int' [-Wsign-conversion]
         {{{
         ::alarm( timeout );
         ~~ ^~~~~~~
         }}}

 * boost/test/impl/plain_report_formatter.ipp:65:28
         **warning: implicit conversion loses integer precision**:
 'counter_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
         {{{
         ostr << std::setw( indent ) << ""
                 ~~~ ^~~~~~
         }}}

 * boost/test/impl/plain_report_formatter.ipp:115:24
         **warning: implicit conversion loses integer precision**:
 'counter_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
         {{{
     ostr << std::setw( m_indent ) << ""
             ~~~ ^~~~~~~~
         }}}

 * boost/test/impl/unit_test_monitor.ipp:64:43
         **warning: implicit conversion changes signedness**: 'const
 unsigned int' to 'int' [-Wsign-conversion]
         {{{
         p_timeout.value = tc.p_timeout.get();
                                         ~ ^~~~~~~~~~~~~~~~~~
         }}}

 * boost/test/utils/runtime/cla/argv_traverser.ipp:79:58
         **warning: implicit conversion changes signedness**: 'long' to
 'std::size_t' (aka 'unsigned long') [-Wsign-conversion]
         {{{
                          BOOST_RT_PARAM_LITERAL( ' ' ) ) -
 m_remainder.get();
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
         }}}

 * boost/test/utils/runtime/cla/argv_traverser.ipp:180:34
         **warning: implicit conversion changes signedness**: 'long' to
 'std::size_t' (aka 'unsigned long') [-Wsign-conversion]
         {{{
     return m_work_buffer.begin() - m_commited_end;
     ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
         }}}

 * boost/test/utils/runtime/cla/named_parameter.ipp:116:27
         **warning: implicit conversion changes signedness**: 'long' to
 'std::size_t' (aka 'unsigned long') [-Wsign-conversion]
         {{{
     tr.trim( mm_pos.first - in.begin() );
     ~~ ~~~~~~~~~~~~~^~~~~~~~~~~~
         }}}

 * boost/test/impl/unit_test_suite.ipp:143:28
         **warning: implicit conversion loses integer precision**: 'const
 unsigned long' to 'unsigned int' [-Wshorten-64-to-32]
         {{{
         increase_exp_fail( tu->p_expected_failures );
         ~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~
         }}}

 * boost/test/impl/unit_test_suite.ipp:146:32
         **warning: implicit conversion loses integer precision**:
 'counter_t' (aka 'unsigned long') to 'unsigned int' [-Wshorten-64-to-32]
         {{{
         tu->increase_exp_fail( expected_failures );
         ~~ ^~~~~~~~~~~~~~~~~
         }}}


 My reading of the standard (5.2.6 [expr.post.incr] & 5.2.1 [expr.sub])
 suggests that clang may be at fault by complaining over the following:
 I include them for completeness - or to be enlightened if I missed
 something... :-)

 * boost/test/utils/runtime/cla/argv_traverser.ipp:193:33
         **warning: implicit conversion changes signedness**: 'std::size_t'
 (aka 'unsigned long') to 'std::ptrdiff_t' (aka 'long') [-Wsign-conversion]
         {{{
     m_remainder[m_remainder_size++] = p_separator;
     ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~^~
         }}}

 * boost/test/utils/runtime/cla/argv_traverser.ipp:80:24
         **warning: implicit conversion changes signedness**: 'std::size_t'
 (aka 'unsigned long') to 'std::ptrdiff_t' (aka 'long') [-Wsign-conversion]
         {{{
         m_remainder[pos++] = BOOST_RT_PARAM_LITERAL( '\0' );
         ~~~~~~~~~~~ ~~~^~
         }}}


 ==== [=#version "clang --version"]
 {{{
 Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
 Target: x86_64-apple-darwin12.4.0
 Thread model: posix
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8992>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC