Elektrine lite

← Feed

@jperkin@federate.me.uk

Post #1641781

2026-04-23 14:05 UTC

If you've ever built a non-trivial amount of software on Solaris / illumos you've almost certainly hit math function errors like this: error: call of overloaded 'log(int)' is ambiguous I got fed up of adding patches to pkgsrc, and I believe I have a patch that fixes this once and for all. https://www.illumos.org/issues/15209#note-4 I'd appreciate wider testing. I've already tested it in a full ~28,000 package bulk build, but changes like this terrify me, and you can't be too careful. #solaris #illumos #pkgsrc

Replies (1)

  • @JdeBP@mastodonapp.uk 2026-04-23 17:25

    @jperkin@federate.me.uk I'm not sure that this is the best fix. Since C++2011, there's been a template for std::log in that takes an integral type argument and so is the best match without ambiguity. https://cplusplus.com/reference/cmath/log/ vide libstdc++ https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libstdc%2B%2B-v3/include/c_global/cmath;hb=HEAD#l322 and libc++ https://github.com/llvm/llvm-project/blob/main/libcxx/include/__math/logarithms.h#L35 Illumos's C++ support in isn't up to date with respect to C++ 2011 (unsurprisingly) and a fix that would actually improve and modernize the C++ support seems to be to add these templates for log and whatnot, in some fashion, with appropriate C++ version and type guards, to head/iso/math_iso.h where all of the other C++1998 overloads already are. That would remove ambiguity for both log(1) and std::log(1). #CPlusPlus #Illumos #gcc #clang

    Open ##1641780