dom/media/MediaStreamGraph.cpp:1093:22: error: call to 'abs' is ambiguous (--enable-debug)

RESOLVED WORKSFORME

Status

()

Core
WebRTC: Audio/Video
RESOLVED WORKSFORME
3 years ago
a year ago

People

(Reporter: Jan Beich, Unassigned)

Tracking

36 Branch
x86
FreeBSD
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
Bug 848954 regressed bug 995543 on 32bit platforms where std::llabs isn't available e.g., gcc or libc++ being picky about c99 math.

In file included from dom/media/Unified_cpp_dom_media1.cpp:119:
dom/media/MediaStreamGraph.cpp:1093:22: error: call to 'abs' is ambiguous
    NS_WARN_IF_FALSE(std::abs(framePosition - CurrentDriver()->StateComputedTime()) <
		     ^~~~~~~~
../../dist/include/nsDebug.h:90:11: note: expanded from macro
'NS_WARN_IF_FALSE'
    if (!(_expr)) {					      \
	  ^
/usr/include/stdlib.h:83:6: note: candidate function
int	 abs(int) __pure2;
	 ^
/usr/include/c++/4.2/cmath:89:3: note: candidate function
  abs(double __x)
  ^
/usr/include/c++/4.2/cmath:93:3: note: candidate function
  abs(float __x)
  ^
/usr/include/c++/4.2/cmath:97:3: note: candidate function
  abs(long double __x)
  ^
/usr/include/c++/4.2/cstdlib:143:3: note: candidate function
  abs(long __i) { return labs(__i); }
  ^
1 error generated.
(Reporter)

Comment 1

3 years ago
I plan to fix with mozilla::Abs but it didn't work on the first Try.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=6871ab383630

In file included from dom/media/Unified_cpp_dom_media1.cpp:119:
dom/media/MediaStreamGraph.cpp:1122:89: error: comparison of integers of different signs: 'typename detail::AbsReturnType<long long>::Type' (aka 'unsigned long long') and 'GraphTime' (aka 'long long') [-Werror,-Wsign-compare]
    NS_WARN_IF_FALSE(mozilla::Abs(framePosition - CurrentDriver()->StateComputedTime()) <
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
dist/include/nsDebug.h:63:11: note: expanded from macro 'NS_WARN_IF_FALSE'
    if (!(_expr)) {                                           \
          ^
1 error generated.
backlog: --- → parking-lot
(Reporter)

Comment 2

a year ago
Bug 962719 removed that call, and I can't reproduce anymore. Not to mention FreeBSD 9.x affected by libstdc++ 4.2 bug would be EOL after 2016-12-31.
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.