Bug 209017

Summary: misc/bdelta: Fix build with libc++ 3.8.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Roman Bogorodskiy <novel>
Status: Closed Overcome By Events    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (novel)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 208158    
Attachments:
Description Flags
Fix type for abs() calls in misc/bdelta none

Description Dimitry Andric freebsd_committer freebsd_triage 2016-04-24 19:39:41 UTC
Created attachment 169640 [details]
Fix type for abs() calls in misc/bdelta

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

libbdelta.cpp:207:13: error: call to 'abs' is ambiguous
        if (abs(lastf1Place-h->hash_items[checkMatches[i]].loc) <
            ^~~

This is because abs() is being called with unsigned arguments.  Fix this by casting the arguments to the appropriate signed type.

[1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-03-22_18h30m05s/logs/errors/bdelta-0.1.0.log
Comment 1 Roman Bogorodskiy freebsd_committer freebsd_triage 2016-04-28 16:24:45 UTC
Hi Dimitry,

I think this patch is superseded by this update: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209063. At least I don't see a similar code in the newer version.
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2016-04-29 14:33:33 UTC
Yep, it's now building without that patch. Thanks.