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

dnsdist: warnings with g++ 12.1.0 on Arch #11619

Closed
rgacogne opened this issue May 11, 2022 · 0 comments · Fixed by #11620
Closed

dnsdist: warnings with g++ 12.1.0 on Arch #11619

rgacogne opened this issue May 11, 2022 · 0 comments · Fixed by #11620

Comments

@rgacogne
Copy link
Member

  • Program: dnsdist
  • Issue type: Bug report

Short description

dnsdist-lua-inspection.cc: In function ‘LuaArray<std::vector<boost::variant<std::__cxx11::basic_string<char>, double> > > getGenResponses(uint64_t, boost::optional<int>, std::function<bool(const Rings::Response&)>)’:
dnsdist-lua-inspection.cc:82:27: warning: narrowing conversion of ‘(count ++)’ from ‘uint64_t’ {aka ‘long unsigned int’} to ‘int’ [-Wnarrowing]
   82 |       ret.push_back({count++, {rc.second.toString(), rc.first, 100.0*rc.first/total}});
      |                      ~~~~~^~
dnsdist-lua-inspection.cc:87:20: warning: narrowing conversion of ‘count’ from ‘uint64_t’ {aka ‘long unsigned int’} to ‘int’ [-Wnarrowing]
   87 |     ret.push_back({count, {"Rest", rest, 100.0*rest/total}});
      |                    ^~~~~
dnsdist-lua-inspection.cc:90:20: warning: narrowing conversion of ‘count’ from ‘uint64_t’ {aka ‘long unsigned int’} to ‘int’ [-Wnarrowing]
   90 |     ret.push_back({count, {"Rest", rest, 100.0 }});
      |                    ^~~~~
  CXX      dnsdist-protobuf.o

dnsdist-rings.cc: In member function ‘std::unordered_map<int, std::vector<boost::variant<std::__cxx11::basic_string<char>, double> > > Rings::getTopBandwidth(unsigned int)’:
dnsdist-rings.cc:120:24: warning: narrowing conversion of ‘(count ++)’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  120 |       ret.insert({count++, {rc.second.toString(), rc.first, 100.0*rc.first/total}});
      |                   ~~~~~^~
dnsdist-rings.cc:125:17: warning: narrowing conversion of ‘count’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  125 |     ret.insert({count, {"Rest", rest, 100.0*rest/total}});
      |                 ^~~~~
dnsdist-rings.cc:128:17: warning: narrowing conversion of ‘count’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
  128 |     ret.insert({count, {"Rest", rest, 100.0 }});
@rgacogne rgacogne added this to the dnsdist-1.8.0 milestone May 11, 2022
Y7n05h added a commit to Y7n05h/pdns that referenced this issue May 12, 2022
Signed-off-by: Y7n05h <Y7n05h@protonmail.com>
Y7n05h added a commit to Y7n05h/pdns that referenced this issue May 12, 2022
Signed-off-by: Y7n05h <Y7n05h@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant