Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.2.12
-
Solaris 11.4 Beta with bundled gcc 5.5
Description
When I tried to compile MariaDB 10.2.12 on Solaris 11.4 Beta (though I'm pretty certain
the same problem exists at least on Solaris 11 if not on 10), sql/item_jsonfunc.cc fails to
compile like this:
/vol/src/mariadb/mariadb-10.2.12/sql/item_jsonfunc.cc:2937:65: error: call of overloaded ‘sqrt(int)’ is ambiguous
|
static const uint SQR_MAX_BLOB_WIDTH= (uint) sqrt(MAX_BLOB_WIDTH);
|
^
|
In file included from /usr/include/math.h:17:0,
|
from /vol/src/mariadb/mariadb-10.2.12/include/my_global.h:332,
|
from /vol/src/mariadb/mariadb-10.2.12/sql/item_jsonfunc.cc:17:
|
/usr/include/iso/math_iso.h:203:21: note: candidate: long double std::sqrt(long double)
|
inline long double sqrt(long double __X) { return __sqrtl(__X); }
|
^
|
/usr/include/iso/math_iso.h:171:15: note: candidate: float std::sqrt(float)
|
inline float sqrt(float __X) { return __sqrtf(__X); }
|
^
|
/usr/include/iso/math_iso.h:65:15: note: candidate: double std::sqrt(double)
|
extern double sqrt __P((double));
|
^
|
The attached patch fixes this by casting the sqrt arg to double to disambiguate.