Closed Bug 1141397 Opened 5 years ago Closed 3 years ago

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

Categories

(Core :: WebRTC: Audio/Video, defect)

36 Branch
x86
FreeBSD
defect
Not set

Tracking

()

RESOLVED WORKSFORME
Blocking Flags:
backlog parking-lot

People

(Reporter: jbeich, Unassigned)

References

Details

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.
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
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
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.