Suspicious compilation warning for Gcc 13 on Fedora 38
Opened this issue · 2 comments
degauden commented
When compiling EleFits on Fedora 38 with gcc 13, I get this warning:
[48/233] Building CXX object EleFitsUtils/CMakeFiles/EleFitsUtils.dir/src/lib/StringUtils.cpp.o
In file included from /usr/include/c++/13/ios:45,
from /usr/include/c++/13/ostream:40,
from /usr/include/boost/system/detail/error_code.hpp:27,
from /usr/include/boost/system/detail/error_category_impl.hpp:15,
from /usr/include/boost/system/error_category.hpp:11,
from /usr/include/boost/filesystem/path_traits.hpp:14,
from /usr/include/boost/filesystem/path.hpp:21,
from /usr/include/boost/filesystem.hpp:16,
from /home/hubert/Work/Space/Euclid/Elements/InstallArea/x86_64-fc38-gcc13-dbg/include/ElementsKernel/Path.h:38,
from /home/hubert/Work/Space/Euclid/Elements/InstallArea/x86_64-fc38-gcc13-dbg/include/ElementsKernel/Auxiliary.h:41,
from /home/hubert/Work/Space/Euclid/EleFits/EleFitsUtils/EleFitsUtils/StringUtils.h:8,
from /home/hubert/Work/Space/Euclid/EleFits/EleFitsUtils/src/lib/StringUtils.cpp:5:
In member function 'std::basic_streambuf<_CharT, _Traits>::char_type* std::basic_streambuf<_CharT, _Traits>::egptr() const [with _CharT = char; _Traits = std::char_traits<char>]',
inlined from 'std::basic_streambuf<_CharT, _Traits>::int_type std::basic_streambuf<_CharT, _Traits>::sbumpc() [with _CharT = char; _Traits = std::char_traits<char>]' at /usr/include/c++/13/streambuf:326:49,
inlined from 'std::istreambuf_iterator<_CharT, _Traits>& std::istreambuf_iterator<_CharT, _Traits>::operator++() [with _CharT = char; _Traits = std::char_traits<char>]' at /usr/include/c++/13/bits/streambuf_iterator.h:173:17,
inlined from 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_construct(_InIterator, _InIterator, std::input_iterator_tag) [with _InIterator = std::istreambuf_iterator<char, std::char_traits<char> >; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/13/bits/basic_string.tcc:178:6,
inlined from 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with _InputIterator = std::istreambuf_iterator<char, std::char_traits<char> >; <template-parameter-2-2> = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/13/bits/basic_string.h:753:16,
inlined from 'std::string Euclid::Fits::String::readFile(const std::string&)' at /home/hubert/Work/Space/Euclid/EleFits/EleFitsUtils/src/lib/StringUtils.cpp:29:80:
/usr/include/c++/13/streambuf:495:30: warning: potential null pointer dereference [-Wnull-dereference]
495 | egptr() const { return _M_in_end; }
| ^~~~~~~~~
In member function 'std::basic_streambuf<_CharT, _Traits>::char_type* std::basic_streambuf<_CharT, _Traits>::gptr() const [with _CharT = char; _Traits = std::char_traits<char>]',
inlined from 'std::basic_streambuf<_CharT, _Traits>::int_type std::basic_streambuf<_CharT, _Traits>::sbumpc() [with _CharT = char; _Traits = std::char_traits<char>]' at /usr/include/c++/13/streambuf:326:33,
inlined from 'std::istreambuf_iterator<_CharT, _Traits>& std::istreambuf_iterator<_CharT, _Traits>::operator++() [with _CharT = char; _Traits = std::char_traits<char>]' at /usr/include/c++/13/bits/streambuf_iterator.h:173:17,
inlined from 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_construct(_InIterator, _InIterator, std::input_iterator_tag) [with _InIterator = std::istreambuf_iterator<char, std::char_traits<char> >; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/13/bits/basic_string.tcc:178:6,
inlined from 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with _InputIterator = std::istreambuf_iterator<char, std::char_traits<char> >; <template-parameter-2-2> = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/13/bits/basic_string.h:753:16,
inlined from 'std::string Euclid::Fits::String::readFile(const std::string&)' at /home/hubert/Work/Space/Euclid/EleFits/EleFitsUtils/src/lib/StringUtils.cpp:29:80:
/usr/include/c++/13/streambuf:492:30: warning: potential null pointer dereference [-Wnull-dereference]
492 | gptr() const { return _M_in_cur; }
| ^~~~~~~~~
In member function 'std::basic_streambuf<_CharT, _Traits>::char_type* std::basic_streambuf<_CharT, _Traits>::egptr() const [with _CharT = char; _Traits = std::char_traits<char>]',
inlined from 'std::basic_streambuf<_CharT, _Traits>::int_type std::basic_streambuf<_CharT, _Traits>::sbumpc() [with _CharT = char; _Traits = std::char_traits<char>]' at /usr/include/c++/13/streambuf:326:49,
inlined from 'std::istreambuf_iterator<_CharT, _Traits>& std::istreambuf_iterator<_CharT, _Traits>::operator++() [with _CharT = char; _Traits = std::char_traits<char>]' at /usr/include/c++/13/bits/streambuf_iterator.h:173:17,
inlined from 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_construct(_InIterator, _InIterator, std::input_iterator_tag) [with _InIterator = std::istreambuf_iterator<char, std::char_traits<char> >; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/13/bits/basic_string.tcc:205:6,
inlined from 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with _InputIterator = std::istreambuf_iterator<char, std::char_traits<char> >; <template-parameter-2-2> = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/13/bits/basic_string.h:753:16,
inlined from 'std::string Euclid::Fits::String::readFile(const std::string&)' at /home/hubert/Work/Space/Euclid/EleFits/EleFitsUtils/src/lib/StringUtils.cpp:29:80:
/usr/include/c++/13/streambuf:495:30: warning: potential null pointer dereference [-Wnull-dereference]
495 | egptr() const { return _M_in_end; }
| ^~~~~~~~~
In member function 'std::basic_streambuf<_CharT, _Traits>::char_type* std::basic_streambuf<_CharT, _Traits>::gptr() const [with _CharT = char; _Traits = std::char_traits<char>]',
inlined from 'std::basic_streambuf<_CharT, _Traits>::int_type std::basic_streambuf<_CharT, _Traits>::sbumpc() [with _CharT = char; _Traits = std::char_traits<char>]' at /usr/include/c++/13/streambuf:326:33,
inlined from 'std::istreambuf_iterator<_CharT, _Traits>& std::istreambuf_iterator<_CharT, _Traits>::operator++() [with _CharT = char; _Traits = std::char_traits<char>]' at /usr/include/c++/13/bits/streambuf_iterator.h:173:17,
inlined from 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_construct(_InIterator, _InIterator, std::input_iterator_tag) [with _InIterator = std::istreambuf_iterator<char, std::char_traits<char> >; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/13/bits/basic_string.tcc:205:6,
inlined from 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with _InputIterator = std::istreambuf_iterator<char, std::char_traits<char> >; <template-parameter-2-2> = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/13/bits/basic_string.h:753:16,
inlined from 'std::string Euclid::Fits::String::readFile(const std::string&)' at /home/hubert/Work/Space/Euclid/EleFits/EleFitsUtils/src/lib/StringUtils.cpp:29:80:
/usr/include/c++/13/streambuf:492:30: warning: potential null pointer dereference [-Wnull-dereference]
492 | gptr() const { return _M_in_cur; }
| ^~~~~~~~~
Please note that it only happens when build in o2g. In full dbg build, le message doesn't appear.
kabasset commented
Seems related to a GCC lib update: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105580
degauden commented
OK. The fix has been scheduled for the GCC 12.4 release, which has not been created yet. I don't know it this will be automatically forward ported to the 13 series.
I guess we have to wait.