[webkit-reviews] review requested: [Bug 27873] [Patch] Fix compile error for ambigous call to abs() : [Attachment 33869] compile fix for ambigous call to abs()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 31 03:54:33 PDT 2009


Harald Fernengel <harry at kdevelop.org> has asked  for review:
Bug 27873: [Patch] Fix compile error for ambigous call to abs()
https://bugs.webkit.org/show_bug.cgi?id=27873

Attachment 33869: compile fix for ambigous call to abs()
https://bugs.webkit.org/attachment.cgi?id=33869&action=review

------- Additional Comments from Harald Fernengel <harry at kdevelop.org>
DateMath.cpp calls abs(long int) - which is ambiguous in some tool chains, for
example on QNX:

/home/harald/qt/qt/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp: In
function 'double WTF::parseDateFromNullTerminatedCharacters(const char*)':
/home/harald/qt/qt/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp:844:
error: call of overloaded 'abs(long int&)' is ambiguous
/opt/qnx640/target/qnx6///usr/include/stdlib.h:122: note: candidates are: int
std::abs(int)
/opt/qnx640/target/qnx6///usr/include/math.h:1042: note:		 long
double std::abs(long double)
/opt/qnx640/target/qnx6///usr/include/math.h:692: note: 		float
std::abs(float)
/opt/qnx640/target/qnx6///usr/include/math.h:624: note: 		double
std::abs(double)
make[1]: *** [obj/debug/DateMath.o] Error 1

Patch replaces the abs() call to labs(), which takes a long int and returns a
long int. This also removes two implicit casts.


More information about the webkit-reviews mailing list