Opened 9 years ago
Closed 9 years ago
#479 closed bug (fixed)
Singular fails to build with GCC 4.7.x on Solaris
Reported by: | Owned by: | somebody | |
---|---|---|---|
Priority: | trivial | Milestone: | 3-2-0 and higher |
Component: | singular-kernel | Version: | 3-1-6 |
Keywords: | floor log10 ambiguous SunOS bigintmat | Cc: | not.really@… |
Description
This is because on Solaris, a couple of C math (and stdlib) functions get overloaded if __cplusplus >= 199711L
(which is the case with GCC 4.7.x), and pulled into the global namespace, such that calling e.g. floor()
or log10()
with an int
, which is done in kernel/bigintmat.cc
, gets ambiguous.
Cf. Sage trac ticket #14295 (where one can find a patch against Singular 3-1-5 as well).
This applies to Singular 3-1-5 as well as 3-1-6, where the latter adds another ambiguous call to floor()
.
The fix is obvious; just use floor((double)(...)
and log10((double)(...))
where appropriate.
P.S.: Using floor()
in int ci = floor(i/col);
is superfluous anyway (since both i
and col
are int
s).
Thanks - fixed as proposed.