patrickfrey / strus

Library implementing the storage and the query evaluation for a text search engine. It uses on a key value store database interface to store its data. Currently there exists an implementation based on the google LevelDB library.
http://www.project-strus.net
Mozilla Public License 2.0
47 stars 1 forks source link

gcc 7.1 warning #99

Open andreasbaumann opened 7 years ago

andreasbaumann commented 7 years ago
[ 23%] Building CXX object src/storage/CMakeFiles/strus_storage_static.dir/forwardIndexMap.cpp.o
In file included from /usr/include/c++/7.2.0/map:60:0,
                 from /data/work/strus/strus/src/storage/forwardIndexBlock.hpp:13,
                 from /data/work/strus/strus/src/storage/forwardIndexMap.hpp:11,
                 from /data/work/strus/strus/src/storage/forwardIndexMap.cpp:8:
/usr/include/c++/7.2.0/bits/stl_tree.h: In function 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_emplace_hint_unique(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, _Args&& ...) [with _Args = {const std::piecewise_construct_t&, std::tuple<const strus::ForwardIndexMap::MapKey&>, std::tuple<>}; _Key = strus::ForwardIndexMap::MapKey; _Val = std::pair<const strus::ForwardIndexMap::MapKey, unsigned int>; _KeyOfValue = std::_Select1st<std::pair<const strus::ForwardIndexMap::MapKey, unsigned int> >; _Compare = std::less<strus::ForwardIndexMap::MapKey>; _Alloc = strus::LocalStructAllocator<std::pair<const strus::ForwardIndexMap::MapKey, unsigned int> >]':
/usr/include/c++/7.2.0/bits/stl_tree.h:2395:7: note: parameter passing for argument of type 'std::_Rb_tree<strus::ForwardIndexMap::MapKey, std::pair<const strus::ForwardIndexMap::MapKey, unsigned int>, std::_Select1st<std::pair<const strus::ForwardIndexMap::MapKey, unsigned int> >, std::less<strus::ForwardIndexMap::MapKey>, strus::LocalStructAllocator<std::pair<const strus::ForwardIndexMap::MapKey, unsigned int> > >::const_iterator {aka std::_Rb_tree_const_iterator<std::pair<const strus::ForwardIndexMap::MapKey, unsigned int> >}' changed in GCC 7.1
       _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/7.2.0/map:61:0,
                 from /data/work/strus/strus/src/storage/forwardIndexBlock.hpp:13,
                 from /data/work/strus/strus/src/storage/forwardIndexMap.hpp:11,
                 from /data/work/strus/strus/src/storage/forwardIndexMap.cpp:8:
/usr/include/c++/7.2.0/bits/stl_map.h: In member function 'void strus::ForwardIndexMap::closeCurblock(const Index&, strus::ForwardIndexMap::CurblockElemList&)':
/usr/include/c++/7.2.0/bits/stl_map.h:493:4: note: parameter passing for argument of type 'std::_Rb_tree<strus::ForwardIndexMap::MapKey, std::pair<const strus::ForwardIndexMap::MapKey, unsigned int>, std::_Select1st<std::pair<const strus::ForwardIndexMap::MapKey, unsigned int> >, std::less<strus::ForwardIndexMap::MapKey>, strus::LocalStructAllocator<std::pair<const strus::ForwardIndexMap::MapKey, unsigned int> > >::const_iterator {aka std::_Rb_tree_const_iterator<std::pair<const strus::ForwardIndexMap::MapKey, unsigned int> >}' changed in GCC 7.1
    __i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
    ^~~
/usr/include/c++/7.2.0/bits/stl_map.h: In member function 'void strus::ForwardIndexMap::renameNewDocNumbers(const std::map<int, int>&)':
/usr/include/c++/7.2.0/bits/stl_map.h:493:4: note: parameter passing for argument of type 'std::_Rb_tree<strus::ForwardIndexMap::MapKey, std::pair<const strus::ForwardIndexMap::MapKey, unsigned int>, std::_Select1st<std::pair<const strus::ForwardIndexMap::MapKey, unsigned int> >, std::less<strus::ForwardIndexMap::MapKey>, strus::LocalStructAllocator<std::pair<const strus::ForwardIndexMap::MapKey, unsigned int> > >::const_iterator {aka std::_Rb_tree_const_iterator<std::pair<const strus::ForwardIndexMap::MapKey, unsigned int> >}' changed in GCC 7.1
    __i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
    ^~~

compiled on ARM, but should happen on other platforms too.

Can this be fixed in a way not to break on older gcc's, I wonder.

andreasbaumann commented 7 years ago

Or is this a bug in the STL?

andreasbaumann commented 7 years ago

https://gcc.gnu.org/ml/gcc/2017-05/msg00073.html

Seems to be a GCC 6 to 7 ABI incompatibility warning.

If the code runs correctly on ARM, I think it's safe to ignore those warnings.

andreasbaumann commented 7 years ago

On the other hand it also means that things are exposed in public APIs of strus, which break if you don't use the same compiler major version to compile them.

patrickfrey commented 6 years ago

Tried to avoid this specific parameter passing of a tree value as reference in order to fix this bug.