[Webkit-unassigned] [Bug 153283] New: Failure to build due to ambiguous use of pow with clang++/libc++

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 20 12:22:18 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=153283

            Bug ID: 153283
           Summary: Failure to build due to ambiguous use of pow with
                    clang++/libc++
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Local Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: krejzi at email.com

Created attachment 269371
  --> https://bugs.webkit.org/attachment.cgi?id=269371&action=review
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++.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160120/300d44ce/attachment.html>


More information about the webkit-unassigned mailing list