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: signed/unsigned comparison warning #5489

Closed
pieterlexis opened this Issue Jul 3, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@pieterlexis
Member

pieterlexis commented Jul 3, 2017

  • Program: dnsdist
  • Issue type: Bug report

Short description

it looks like the TimedIPSetRule does signed/unsigned comparisons:

In file included from dnsdist-lua.cc:26:0:
dnsrulactions.hh: In member function ‘virtual bool TimedIPSetRule::matches(const DNSQuestion*) const’:
dnsrulactions.hh:167:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       return time(0) < fnd->second;
                      ^
dnsrulactions.hh:174:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       return time(0) < fnd->second;
                      ^
dnsrulactions.hh: In member function ‘void TimedIPSetRule::cleanup()’:
dnsrulactions.hh:224:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if(iter->second < now)
                  ^
dnsrulactions.hh:236:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if(iter->second < now)
                  ^
dnsrulactions.hh: In member function ‘virtual std::string TimedIPSetRule::toString() const’:
dnsrulactions.hh:253:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(now < ip.second)
                ^
dnsrulactions.hh:259:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(now < ip.second)
                ^

Found when building dnsdist on raspbian (ARM)

@pieterlexis

This comment has been minimized.

Member

pieterlexis commented Jul 3, 2017

Another one:

dnsdist-tcp.cc: In function ‘bool maxConnectionDurationReached(unsigned int, time_t, unsigned int&)’:
dnsdist-tcp.cc:194:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (elapsed >= maxConnectionDuration) {
                 ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment