NetBSD 6.1.5 doesn't have ldexpl in math.h

Hal Murray hmurray at megapathdsl.net
Thu Sep 7 08:37:30 UTC 2017


devel at ntpsec.org said:
> ldexpl() is POSIX 2008 and ISO/IEC 9899:1999 (a.k.a. C99). =20
> Not supporting C99 is pretty lame.  NTPsec specifically requires C99
> support.

> So clearly a NetBSD problem.

Thanks.

Looks like they tried but didn't get everything.  The man page says:
       The described functions conform to ISO/IEC 9899:1999 (``ISO C99'').
Of course, that doesn't say the whole system confirms to C99, just ldexp and 
ldexpf, but I'll interpret it as meaning that they tried to cover the whole 
C99.

> Maybe ldexpl() is in math.h, but if behind an #ifdef? 

Nope.  grep doesn't find it.

> Got a workaround? 

This seems to build and check:
#include <math.h>       /* ldexpl() */
#ifndef ldexpl
  /* Missing in NetBSD 6.1.5 */
  #define ldexpl ldexp
#endif

Will that do the right conversions between double and long double?

Do we want to work with old but still supported NetBSD or be sticky about 
requiring C99?

Eric:  Do we have a list of OSes and hardware where ntpsec is known to build 
and work?

----------

grep does find this in /usr/include/g++/cmath
  inline long double
  ldexp(long double __x, int __exp)
  { return __builtin_ldexpl(__x, __exp); }

I screwed around trying to make something like that work and didn't find a 
recipe.  It might be possible, but it requires some skills I don't have.

I'll itemize what I tried if anybody is interested.


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list