WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
153283
Failure to build due to ambiguous use of pow with clang++/libc++
https://bugs.webkit.org/show_bug.cgi?id=153283
Summary
Failure to build due to ambiguous use of pow with clang++/libc++
Armin K.
Reported
2016-01-20 12:22:18 PST
Created
attachment 269371
[details]
Build fix When building with clang++/libc++ on Linux, the build fails with the following error: [ 14%] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/rendering/shapes/BoxShape.cpp.o /home/armin/src/webkitgtk-2.10.5/Source/WebCore/rendering/shapes/BoxShape.cpp:46:40: error: call to 'pow' is ambiguous return radius + (margin * (1 + pow(ratio - 1, 3))); ^~~~~~~~ /usr/include/bits/mathcalls.h:153:17: note: candidate function __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y)); ^ /usr/bin/../include/c++/v1/math.h:869:46: note: candidate function inline _LIBCPP_INLINE_VISIBILITY float pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return powf(__lcpp_x, __lcpp_y);} ^ /usr/bin/../include/c++/v1/math.h:870:46: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return powl(__lcpp_x, __lcpp_y);} The problem is that both arguments passed to pow are integers and compiler can't decide whether to convert it to float, double or long double. It has to be explicitly converted. Attached patch works for me since floating point numbers will be treated as double by default in C++.
Attachments
Build fix
(413 bytes, patch)
2016-01-20 12:22 PST
,
Armin K.
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Michael Catanzaro
Comment 1
2016-01-20 12:25:59 PST
Thanks. Already fixed in
r195011
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug