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

Uninitialized variable warnings #42

Open
pieterlexis opened this issue Mar 30, 2018 · 0 comments
Open

Uninitialized variable warnings #42

pieterlexis opened this issue Mar 30, 2018 · 0 comments

Comments

@pieterlexis
Copy link

Found while compiling dnsdist 1.3.0 on Arch Linux.

  • gcc --version: gcc (GCC) 7.3.1 20180312
In file included from dnsdist.hh:24:0,
                 from dnsdist-lua-inspection.cc:22:
ext/luawrapper/include/LuaContext.hpp: In static member function ‘static int LuaContext::Pusher<TReturnType(TParameters ...)>::push(lua_State*, TFunctionObject) [with TFunctionObject = setupLuaInspection()::<lambda(unsigned int, boost::optional<int>)>; TReturnType = std::unordered_map<unsigned int, std::vector<boost::variant<std::__cxx11::basic_string<char>, double> > >; TParameters = {unsigned int, boost::optional<int>}]::<lambda(lua_State*)>::_FUN(lua_State*)’:
ext/luawrapper/include/LuaContext.hpp:1806:68: warning: ‘*((void*)&<anonymous> +4)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             return function(param, std::forward<TParams>(params)...);
                                                                    ^
ext/luawrapper/include/LuaContext.hpp: In static member function ‘static int LuaContext::Pusher<TReturnType(TParameters ...)>::push(lua_State*, TFunctionObject) [with TFunctionObject = setupLuaInspection()::<lambda(boost::variant<std::__cxx11::basic_string<char>, std::vector<std::pair<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >, boost::optional<unsigned int>)>; TReturnType = void; TParameters = {boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::pair<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >, boost::optional<unsigned int>}]::<lambda(lua_State*)>::_FUN(lua_State*)’:
ext/luawrapper/include/LuaContext.hpp:1806:68: warning: ‘*((void*)&<anonymous> +4)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             return function(param, std::forward<TParams>(params)...);
                                                                    ^
  CXX      dnsdist-protobuf.o
In file included from dnsdist.hh:24:0,
                 from dnsdist-lua.cc:31:
ext/luawrapper/include/LuaContext.hpp: In function ‘static typename std::enable_if<LuaContext::IsOptional<TFirstType>::value, TRetValue>::type LuaContext::readIntoFunction(lua_State*, LuaContext::tag<TRetValue>, TCallback&&, int, LuaContext::tag<TObject>, LuaContext::tag<TTypes>...) [with TRetValue = void; TCallback = LuaContext::Binder<LuaContext::Binder<LuaContext::Binder<setupLuaConfig(bool)::<lambda(const std::vector<std::pair<unsigned int, std::__cxx11::basic_string<char> > >&, const string&, boost::optional<int>, boost::optional<DNSAction::Action>)>&, const std::vector<std::pair<unsigned int, std::__cxx11::basic_string<char> > >&>&, const std::__cxx11::basic_string<char>&>&, const boost::optional<int>&>&; TFirstType = boost::optional<DNSAction::Action>; TTypes = {}]’:
ext/luawrapper/include/LuaContext.hpp:1806:68: warning: ‘*((void*)&<anonymous> +4)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             return function(param, std::forward<TParams>(params)...);
                                                                    ^
ext/luawrapper/include/LuaContext.hpp: In static member function ‘static int LuaContext::Pusher<TReturnType(TParameters ...)>::push(lua_State*, TFunctionObject) [with TFunctionObject = setupLuaConfig(bool)::<lambda(boost::optional<unsigned int>)>; TReturnType = void; TParameters = {boost::optional<unsigned int>}]::<lambda(lua_State*)>::_FUN(lua_State*)’:
ext/luawrapper/include/LuaContext.hpp:1806:68: warning: ‘*((void*)&<anonymous> +4)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             return function(param, std::forward<TParams>(params)...);
                                                                    ^
ext/luawrapper/include/LuaContext.hpp: In function ‘static typename std::enable_if<(! LuaContext::IsOptional<TFirstType>::value), TRetValue>::type LuaContext::readIntoFunction(lua_State*, LuaContext::tag<TRetValue>, TCallback&&, int, LuaContext::tag<TObject>, LuaContext::tag<TTypes>...) [with TRetValue = std::shared_ptr<DownstreamState>; TCallback = setupLuaConfig(bool)::<lambda(boost::variant<std::__cxx11::basic_string<char>, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::pair<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::function<std::tuple<DNSName, short unsigned int, short unsigned int>(const DNSName&, short unsigned int, short unsigned int, dnsheader*)> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::pair<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::function<std::tuple<DNSName, short unsigned int, short unsigned int>(const DNSName&, short unsigned int, short unsigned int, dnsheader*)> > > > > >, boost::optional<int>)>&; TFirstType = boost::variant<std::__cxx11::basic_string<char>, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::pair<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::function<std::tuple<DNSName, short unsigned int, short unsigned int>(const DNSName&, short unsigned int, short unsigned int, dnsheader*)> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::pair<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::function<std::tuple<DNSName, short unsigned int, short unsigned int>(const DNSName&, short unsigned int, short unsigned int, dnsheader*)> > > > > >; TTypes = {boost::optional<int>}]’:
ext/luawrapper/include/LuaContext.hpp:1806:68: warning: ‘*((void*)&<anonymous> +4)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             return function(param, std::forward<TParams>(params)...);
                                                                    ^
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