Bug 209371 - comms/svxlink: Fix build with libc++ 3.8.0
Summary: comms/svxlink: Fix build with libc++ 3.8.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Diane Bruce
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-07 22:58 UTC by Dimitry Andric
Modified: 2016-05-28 19:14 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (hamradio)


Attachments
Fix type for abs() call in comms/svxlink (1.14 KB, patch)
2016-05-07 22:58 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2016-05-07 22:58:14 UTC
Created attachment 170105 [details]
Fix type for abs() call in comms/svxlink

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

/wrkdirs/usr/ports/comms/svxlink/work/svxlink-15.11/src/async/audio/AsyncAudioDeviceAlsa.cpp:551:7: error: call to 'abs' is ambiguous
  if (::abs(real_rate - sample_rate) > 100)
      ^~~~~

This is because abs() is being called with an unsigned argument.  Fix this by casting 'real_rate' to int, since it was assigned from 'sample_rate' anyhow.

[1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-05-01_10h29m48s/logs/errors/svxlink-15.11.log
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-05-28 15:31:43 UTC
A commit references this bug:

Author: db
Date: Sat May 28 15:30:41 UTC 2016
New revision: 416003
URL: https://svnweb.freebsd.org/changeset/ports/416003

Log:
  Summary: comms/svxlink: Fix build with libc++ 3.8.0

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

  /wrkdirs/usr/ports/comms/svxlink/work/svxlink-15.11/src/async/audio/AsyncAudioDe
  +viceAlsa.cpp:551:7:
  error: call to 'abs' is ambiguous
    if (::abs(real_rate - sample_rate) > 100)
        ^~~~~

  This is because abs() is being called with an unsigned argument.  Fix this by
  casting 'real_rate' to int, since it was assigned from 'sample_rate' anyhow.

  PR:		ports/209371
  Reported by:	@dim

Changes:
  head/comms/svxlink/files/patch-src_async_audio_AsyncAudioDeviceAlsa.cpp