Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various build warnings #3

Open
seahawk1986 opened this issue Sep 12, 2024 · 0 comments
Open

Various build warnings #3

seahawk1986 opened this issue Sep 12, 2024 · 0 comments

Comments

@seahawk1986
Copy link

Hi,
with the commit fb52ff9 I get those build warnings - are the first two intentional?

g++ -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses -fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -c -DPLUGIN_NAME_I18N='"iptv"' -DTS_ONLY_FULL_PACKETS=0  -o iptv.o iptv.cpp
In file included from protocolm3u.h:9,
                 from device.h:18,
                 from iptv.h:13,
                 from iptv.cpp:8:
source.h: In member function 'virtual cString cPluginIptv::SVDRPCommand(const char*, const char*, int&)':
source.h:54:52: warning: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' specified bound 256 equals destination size [-Wstringop-truncation]
   54 |     void SetAddress(const char *addressP) { strncpy(addressM, addressP, sizeof(addressM)); };
      |                                                    ^
g++ -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses -fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -c -DPLUGIN_NAME_I18N='"iptv"' -DTS_ONLY_FULL_PACKETS=0  -o setup.o setup.cpp
setup.cpp: In member function 'void cIptvPluginSetup::StoreFilters(const char*, int*)':
setup.cpp:239:16: warning: 'char* __builtin___strncpy_chk(char*, const char*, long unsigned int, long unsigned int)' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
  239 |         strncpy(q, s, strlen(s));
      |                ^
setup.cpp:239:16: note: length computed here
  239 |         strncpy(q, s, strlen(s));
      |         ~~~~~~~^~~~~~~~~~~~~~~~~
g++ -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses -fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -c -DPLUGIN_NAME_I18N='"iptv"' -DTS_ONLY_FULL_PACKETS=0  -o m3u8handler.o m3u8handler.cpp
In file included from /usr/include/c++/13/regex:68,
                 from httplib.h:220,
                 from m3u8handler.h:11,
                 from m3u8handler.cpp:1:
In member function 'std::__cxx11::sub_match<_BiIter>::difference_type std::__cxx11::sub_match<_BiIter>::length() const [with _BiIter = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >]',
    inlined from 'std::__cxx11::match_results<_Bi_iter, _Alloc>::difference_type std::__cxx11::match_results<_Bi_iter, _Alloc>::length(size_type) const [with _Bi_iter = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >]' at /usr/include/c++/13/bits/regex.h:1907:37,
    inlined from 'bool httplib::detail::parse_www_authenticate(const httplib::Response&, std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&, bool)' at httplib.h:4713:30:
/usr/include/c++/13/bits/regex.h:942:22: warning: array subscript -3 is outside array bounds of 'std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > [384307168202282325]' [-Warray-bounds=]
  942 |       { return this->matched ? std::distance(this->first, this->second) : 0; }
      |                ~~~~~~^~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/c++allocator.h:33,
                 from /usr/include/c++/13/bits/allocator.h:46,
                 from /usr/include/c++/13/string:43,
                 from /usr/include/c++/13/bits/locale_classes.h:40,
                 from /usr/include/c++/13/bits/ios_base.h:41,
                 from /usr/include/c++/13/ios:44,
                 from /usr/include/c++/13/ostream:40,
                 from /usr/include/c++/13/iostream:41,
                 from m3u8handler.h:3:
In member function '_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >]',
    inlined from 'static _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >]' at /usr/include/c++/13/bits/alloc_traits.h:482:28,
    inlined from 'std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >]' at /usr/include/c++/13/bits/stl_vector.h:381:33,
    inlined from 'void std::_Vector_base<_Tp, _Alloc>::_M_create_storage(std::size_t) [with _Tp = std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >]' at /usr/include/c++/13/bits/stl_vector.h:398:44,
    inlined from 'std::_Vector_base<_Tp, _Alloc>::_Vector_base(std::size_t, const allocator_type&) [with _Tp = std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >]' at /usr/include/c++/13/bits/stl_vector.h:335:26,
    inlined from 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >]' at /usr/include/c++/13/bits/stl_vector.h:603:61,
    inlined from 'std::__cxx11::match_results<_Bi_iter, _Alloc>::match_results(const std::__cxx11::match_results<_Bi_iter, _Alloc>&) [with _Bi_iter = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > > >]' at /usr/include/c++/13/bits/regex.h:1815:7,
    inlined from 'bool httplib::detail::parse_www_authenticate(const httplib::Response&, std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&, bool)' at httplib.h:4710:21:
/usr/include/c++/13/bits/new_allocator.h:151:55: note: at offset -72 into object of size [1, 9223372036854775800] allocated by 'operator new'
  151 |         return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
      |                                                       ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant