uNetworking / uWebSockets

Simple, secure & standards compliant web server for the most demanding of applications
Apache License 2.0
17.24k stars 1.75k forks source link

GCC Warning #1177

Closed hellow554 closed 3 years ago

hellow554 commented 3 years ago

I'm compiling with gcc 10.2 and the following warning pops up:

/usr/include/c++/10.2.0/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {fu2::abi_400::detail::function<fu2::abi_400::detail::config<true, false, fu2::capacity_default>, fu2::abi_400::detail::property<true, false, bool(uWS::HttpRouter<uWS::HttpContextData<false>::RouterData>*)> >}; _Tp = fu2::abi_400::detail::function<fu2::abi_400::detail::config<true, false, fu2::capacity_default>, fu2::abi_400::detail::property<true, false, bool(uWS::HttpRouter<uWS::HttpContextData<false>::RouterData>*)> >; _Alloc = std::allocator<fu2::abi_400::detail::function<fu2::abi_400::detail::config<true, false, fu2::capacity_default>, fu2::abi_400::detail::property<true, false, bool(uWS::HttpRouter<uWS::HttpContextData<false>::RouterData>*)> > >]':
/usr/include/c++/10.2.0/bits/vector.tcc:426:7: note: parameter passing for argument of type 'std::vector<fu2::abi_400::detail::function<fu2::abi_400::detail::config<true, false, fu2::capacity_default>, fu2::abi_400::detail::property<true, false, bool(uWS::HttpRouter<uWS::HttpContextData<false>::RouterData>*)> >, std::allocator<fu2::abi_400::detail::function<fu2::abi_400::detail::config<true, false, fu2::capacity_default>, fu2::abi_400::detail::property<true, false, bool(uWS::HttpRouter<uWS::HttpContextData<false>::RouterData>*)> > > >::iterator' changed in GCC 7.1
  426 |       vector<_Tp, _Alloc>::
      |       ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/10.2.0/bits/vector.tcc: In member function 'void uWS::HttpRouter<USERDATA>::add(std::vector<std::__cxx11::basic_string<char> >, std::string, fu2::unique_function<bool(uWS::HttpRouter<USERDATA>*)>&&, uint32_t) [with USERDATA = uWS::HttpContextData<false>::RouterData]':
/usr/include/c++/10.2.0/bits/vector.tcc:121:21: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<fu2::abi_400::detail::function<fu2::abi_400::detail::config<true, false, fu2::capacity_default>, fu2::abi_400::detail::property<true, false, bool(uWS::HttpRouter<uWS::HttpContextData<false>::RouterData>*)> >*, std::vector<fu2::abi_400::detail::function<fu2::abi_400::detail::config<true, false, fu2::capacity_default>, fu2::abi_400::detail::property<true, false, bool(uWS::HttpRouter<uWS::HttpContextData<false>::RouterData>*)> >, std::allocator<fu2::abi_400::detail::function<fu2::abi_400::detail::config<true, false, fu2::capacity_default>, fu2::abi_400::detail::property<true, false, bool(uWS::HttpRouter<uWS::HttpContextData<false>::RouterData>*)> > > > >' changed in GCC 7.1
  121 |    _M_realloc_insert(end(), std::forward<_Args>(__args)...);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(wonderful how C++ messages look, right?)

So, the important message is this:

In member function 'void uWS::HttpRouter<USERDATA>::add(std::vector<std::string<char>>, std::string, fu2::unique_function<bool(uWS::HttpRouter<USERDATA>*)>&&, uint32_t)

note: parameter passing for argument of type [...] changed in GCC 7.1

I would like that message to disappear ;)

Is there more information you need, e.g. some code, or can you work with this?

ghost commented 3 years ago

I have GCC 10.2.1 and 9.3.0 and I don't see any warnings?

hellow554 commented 3 years ago

This is somewhat confusing. I'm cross compiling for an ARM target, but you're right. When I use the systemd default x86 g++ there are no warning (except one in the function2.hpp)

uWebSockets/src/f2/function2.hpp:1131:9: warning: the address of ‘static void WS::end()::<lambda()>::_FUN()’ will never be NULL [-Waddress]
 1131 |     if (bool(callable)) {

but, no view of that other one.

But when I compile with my cross compiler, the warning from my first post appears...

Strange...

hellow554 commented 3 years ago

Indeed, this seems to be an "issue" with the arm compiler, see:

https://stackoverflow.com/questions/48149323/what-does-the-gcc-warning-project-parameter-passing-for-x-changed-in-gcc-7-1-m

The question is, this doesn't seem to be a problem with the library itself, so I guess this can be closed an I have to add -Wno-psabi?

ghost commented 3 years ago

It looks like an honest warning, for the sake of warning you. I would just ignore it. It's not related to this library.