Bug 208725

Summary: [PATCH] dns/powerdns: Fix build with libc++ 3.8.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Some People CC: lme, tremere
Priority: --- Flags: tremere: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 208158    
Attachments:
Description Flags
Replace abs() on unsigned arguments in dns/powerdns
none
Replace suggested patch with commit from upstream tremere: maintainer-approval+

Description Dimitry Andric freebsd_committer 2016-04-11 18:41:14 UTC
Created attachment 169220 [details]
Replace abs() on unsigned arguments in dns/powerdns

During the exp-run in bug 208158, it was found that dns/powerdns gives errors with libc++ 3.8.0 [1]:

dnspacket.cc:645:6: error: call to 'abs' is ambiguous
  if(abs(trc->d_time - now) > trc->d_fudge) {
     ^~~

This is because abs() is being called with unsigned arguments.  Fix this calculating the time difference in a more portable way.

[1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-03-22_18h30m05s/logs/errors/powerdns-3.4.8.log
Comment 1 Ralf van der Enden 2016-04-12 07:10:06 UTC
Created attachment 169232 [details]
Replace suggested patch with commit from upstream

Fixed upstream in this commit:
https://github.com/ahupowerdns/pdns/commit/f2d05dd430abdb4e630387275af0bd5477eef71b
Comment 2 Ralf van der Enden 2016-04-18 07:15:14 UTC
Comment on attachment 169220 [details]
Replace abs() on unsigned arguments in dns/powerdns

This one is obsolete, but I cannot tag it as such.
Comment 3 commit-hook freebsd_committer 2016-04-26 18:18:41 UTC
A commit references this bug:

Author: dim
Date: Tue Apr 26 18:18:15 UTC 2016
New revision: 414065
URL: https://svnweb.freebsd.org/changeset/ports/414065

Log:
  During the exp-run in bug 208158, it was found that dns/powerdns gives
  errors with libc++ 3.8.0:

  dnspacket.cc:645:6: error: call to 'abs' is ambiguous
    if(abs(trc->d_time - now) > trc->d_fudge) {
       ^~~

  This is because abs() is being called with unsigned arguments.  Import
  upstream commit f2d05dd to fix it.

  Approved by:	tremere@cainites.net
  PR:		208725
  MFH:		2016Q2

Changes:
  head/dns/powerdns/files/patch-pdns_dnspacket.cc
Comment 4 commit-hook freebsd_committer 2016-04-27 11:06:54 UTC
A commit references this bug:

Author: dim
Date: Wed Apr 27 11:06:01 UTC 2016
New revision: 414098
URL: https://svnweb.freebsd.org/changeset/ports/414098

Log:
  MFH: r414065

  During the exp-run in bug 208158, it was found that dns/powerdns gives
  errors with libc++ 3.8.0:

  dnspacket.cc:645:6: error: call to 'abs' is ambiguous
    if(abs(trc->d_time - now) > trc->d_fudge) {
       ^~~

  This is because abs() is being called with unsigned arguments.  Import
  upstream commit f2d05dd to fix it.

  Approved by:	portmgr (junovitch)
  PR:		208725

Changes:
_U  branches/2016Q2/
  branches/2016Q2/dns/powerdns/files/patch-pdns_dnspacket.cc