Opened 9 years ago
Closed 9 years ago
#8525 closed Bugs (fixed)
Iterator library warnings
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | To Be Determined | Component: | serialization |
Version: | Boost 1.53.0 | Severity: | Problem |
Keywords: | iterator warning | Cc: |
Description
Hi,
I built Boost 1.53.0 on Fedora 18 32/64-bit using the following command:
./b2 link=shared runtime-link=shared address-model=32|64 variant=release
and received the following messages:
./boost/archive/iterators/transform_width.hpp: In instantiation of ‘boost::archive::iterators::transform_width<Base, BitsOut, BitsIn, CharType>::transform_width(const boost::archive::iterators::transform_width<Base, BitsOut, BitsIn, CharType>&) [with Base = const char*; int BitsOut = 6; int BitsIn = 8; CharType = char]’: ./boost/archive/iterators/base64_from_binary.hpp:103:9: required from ‘boost::archive::iterators::base64_from_binary<Base, CharType>::base64_from_binary(const boost::archive::iterators::base64_from_binary<Base, CharType>&) [with Base = boost::archive::iterators::transform_width<const char*, 6, 8>; CharType = char]’ ./boost/iterator/iterator_adaptor.hpp:276:28: required from ‘boost::iterator_adaptor<Derived, Base, Value, Traversal, Reference, Difference>::iterator_adaptor(const Base&) [with Derived = boost::archive::iterators::insert_linebreaks<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<const char*, 6, 8> >, 76, const char>; Base = boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<const char*, 6, 8> >; Value = const char; Traversal = boost::single_pass_traversal_tag; Reference = const char; Difference = boost::use_default]’ ./boost/archive/iterators/insert_linebreaks.hpp:88:18: required from ‘boost::archive::iterators::insert_linebreaks<Base, N, CharType>::insert_linebreaks(T) [with T = const char*; Base = boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<const char*, 6, 8> >; int N = 76; CharType = const char]’ ./boost/archive/impl/basic_text_oprimitive.ipp:60:5: required from ‘void boost::archive::basic_text_oprimitive<OStream>::save_binary(const void*, std::size_t) [with OStream = std::basic_ostream<char>; std::size_t = unsigned int]’ libs/serialization/src/basic_text_oprimitive.cpp:25:16: required from here ./boost/archive/iterators/transform_width.hpp:104:18: warning: ‘boost::archive::iterators::transform_width<const char*, 6, 8>::m_remaining_bits’ will be initialized after [-Wreorder] ./boost/archive/iterators/transform_width.hpp:101:21: warning: ‘boost::archive::iterators::transform_width<const char*, 6, 8>::base_value_type boost::archive::iterators::transform_width<const char*, 6, 8>::m_buffer_in’ [-Wreorder] ./boost/archive/iterators/transform_width.hpp:119:5: warning: when initialized here [-Wreorder] ./boost/archive/iterators/transform_width.hpp: In member function ‘void boost::archive::basic_text_iprimitive<IStream>::load_binary(void*, std::size_t) [with IStream = std::basic_istream<wchar_t>; std::size_t = unsigned int]’: ./boost/archive/iterators/transform_width.hpp:153:65: warning: ‘i.boost::archive::iterators::transform_width<boost::archive::iterators::binary_from_base64<boost::archive::iterators::remove_whitespace<boost::archive::iterators::istream_iterator<wchar_t> >, wchar_t>, 8, 6, wchar_t>::m_buffer_in’ may be used uninitialized in this function [-Wmaybe-uninitialized] In file included from ./boost/archive/impl/basic_text_iprimitive.ipp:31:0,
from libs/serialization/src/basic_text_wiprimitive.cpp:25:
./boost/archive/iterators/transform_width.hpp: In instantiation of ‘boost::archive::iterators::transform_width<Base, BitsOut, BitsIn, CharType>::transform_width(const boost::archive::iterators::transform_width<Base, BitsOut, BitsIn, CharType>&) [with Base = boost::archive::iterators::binary_from_base64<boost::archive::iterators::remove_whitespace<boost::archive::iterators::istream_iterator<wchar_t> >, wchar_t>; int BitsOut = 8; int BitsIn = 6; CharType = wchar_t]’: ./boost/archive/impl/basic_text_iprimitive.ipp:94:5: required from ‘void boost::archive::basic_text_iprimitive<IStream>::load_binary(void*, std::size_t) [with IStream = std::basic_istream<wchar_t>; std::size_t = unsigned int]’ libs/serialization/src/basic_text_wiprimitive.cpp:30:16: required from here ./boost/archive/iterators/transform_width.hpp:104:18: warning: ‘boost::archive::iterators::transform_width<boost::archive::iterators::binary_from_base64<boost::archive::iterators::remove_whitespace<boost::archive::iterators::istream_iterator<wchar_t> >, wchar_t>, 8, 6, wchar_t>::m_remaining_bits’ will be initialized after [-Wreorder] ./boost/archive/iterators/transform_width.hpp:101:21: warning: ‘boost::archive::iterators::transform_width<boost::archive::iterators::binary_from_base64<boost::archive::iterators::remove_whitespace<boost::archive::iterators::istream_iterator<wchar_t> >, wchar_t>, 8, 6, wchar_t>::base_value_type boost::archive::iterators::transform_width<boost::archive::iterators::binary_from_base64<boost::archive::iterators::remove_whitespace<boost::archive::iterators::istream_iterator<wchar_t> >, wchar_t>, 8, 6, wchar_t>::m_buffer_in’ [-Wreorder] ./boost/archive/iterators/transform_width.hpp:119:5: warning: when initialized here [-Wreorder] ./boost/archive/iterators/transform_width.hpp: In member function ‘void boost::archive::basic_text_iprimitive<IStream>::load_binary(void*, std::size_t) [with IStream = std::basic_istream<wchar_t>; std::size_t = unsigned int]’: ./boost/archive/iterators/transform_width.hpp:153:65: warning: ‘i.boost::archive::iterators::transform_width<boost::archive::iterators::binary_from_base64<boost::archive::iterators::remove_whitespace<boost::archive::iterators::istream_iterator<wchar_t> >, wchar_t>, 8, 6, wchar_t>::m_buffer_in’ may be used uninitialized in this function [-Wmaybe-uninitialized] ./boost/archive/iterators/transform_width.hpp: In instantiation of ‘boost::archive::iterators::transform_width<Base, BitsOut, BitsIn, CharType>::transform_width(const boost::archive::iterators::transform_width<Base, BitsOut, BitsIn, CharType>&) [with Base = const char*; int BitsOut = 6; int BitsIn = 8; CharType = char]’: ./boost/archive/iterators/base64_from_binary.hpp:103:9: required from ‘boost::archive::iterators::base64_from_binary<Base, CharType>::base64_from_binary(const boost::archive::iterators::base64_from_binary<Base, CharType>&) [with Base = boost::archive::iterators::transform_width<const char*, 6, 8>; CharType = char]’ ./boost/iterator/iterator_adaptor.hpp:276:28: required from ‘boost::iterator_adaptor<Derived, Base, Value, Traversal, Reference, Difference>::iterator_adaptor(const Base&) [with Derived = boost::archive::iterators::insert_linebreaks<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<const char*, 6, 8> >, 76, const char>; Base = boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<const char*, 6, 8> >; Value = const char; Traversal = boost::single_pass_traversal_tag; Reference = const char; Difference = boost::use_default]’ ./boost/archive/iterators/insert_linebreaks.hpp:88:18: required from ‘boost::archive::iterators::insert_linebreaks<Base, N, CharType>::insert_linebreaks(T) [with T = const char*; Base = boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<const char*, 6, 8> >; int N = 76; CharType = const char]’ ./boost/archive/impl/basic_text_oprimitive.ipp:60:5: required from ‘void boost::archive::basic_text_oprimitive<OStream>::save_binary(const void*, std::size_t) [with OStream = std::basic_ostream<wchar_t>; std::size_t = unsigned int]’ libs/serialization/src/basic_text_woprimitive.cpp:30:16: required from here ./boost/archive/iterators/transform_width.hpp:104:18: warning: ‘boost::archive::iterators::transform_width<const char*, 6, 8>::m_remaining_bits’ will be initialized after [-Wreorder] ./boost/archive/iterators/transform_width.hpp:101:21: warning: ‘boost::archive::iterators::transform_width<const char*, 6, 8>::base_value_type boost::archive::iterators::transform_width<const char*, 6, 8>::m_buffer_in’ [-Wreorder] ./boost/archive/iterators/transform_width.hpp:119:5: warning: when initialized here [-Wreorder]
Attachments (1)
Change History (5)
by , 9 years ago
Attachment: | 8525.patch added |
---|
comment:1 by , 9 years ago
I have now added a patch for this issue. I fixed the uninitialized member warning even though it appears to be a false positive since the fix was inexpensive.
comment:2 by , 9 years ago
Component: | iterator → serialization |
---|---|
Owner: | changed from | to
comment:3 by , 9 years ago
Several (perhaps not all?) of these warnings remain with boost 1.54 beta1. specifically
./boost/archive/iterators/transform_width.hpp:101:21: warning: ‘boost::archive::iterators::transform_width<const char*, 6, 8>::base_value_type boost::archive::iterators::transform_width<const char*, 6, 8>::m_buffer_in’ [-Wreorder]
Patch for warnings