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

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

dnsdist: signed/unsigned comparison warning #5489

pieterlexis opened this issue Jul 3, 2017 · 1 comment

Comments

@pieterlexis
Copy link
Member

@pieterlexis 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
Copy link
Member Author

@pieterlexis 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants