svn commit: r322418 - head/lib/msun/src

Ryan Libby rlibby at freebsd.org
Sun Aug 13 00:14:21 UTC 2017


On Sat, Aug 12, 2017 at 2:53 PM, Ngie Cooper (yaneurabeya)
<yaneurabeya at gmail.com> wrote:
[...]
>         Here are the full gamut of definitions for LDBL_MAX_EXP. It seems that sparc64 isn’t the only architecture using this pattern:
>
> $ grep -r DBL_MAX_EXP sys/*/include
> sys/arm/include/float.h:#define DBL_MAX_EXP     1024
> sys/arm/include/float.h:#define LDBL_MAX_EXP    DBL_MAX_EXP
> sys/arm64/include/float.h:#define       DBL_MAX_EXP     1024
> sys/arm64/include/float.h:#define       LDBL_MAX_EXP    (+16384)
> sys/mips/include/float.h:#define        DBL_MAX_EXP     1024
> sys/mips/include/float.h:#define        LDBL_MAX_EXP    DBL_MAX_EXP
> sys/powerpc/include/float.h:#define DBL_MAX_EXP 1024
> sys/powerpc/include/float.h:#define LDBL_MAX_EXP        DBL_MAX_EXP
> sys/riscv/include/float.h:#define       DBL_MAX_EXP     1024
> sys/riscv/include/float.h:#define       LDBL_MAX_EXP    (+16384)
> sys/sparc64/include/float.h:#define DBL_MAX_EXP 1024
> sys/sparc64/include/float.h:#define LDBL_MAX_EXP        (+16384)
> sys/x86/include/float.h:#define DBL_MAX_EXP     1024
> sys/x86/include/float.h:#define LDBL_MAX_EXP    16384
>
>         It might also be an inconsistency with how clang vs gcc [4.2.1] handles __CONCAT, and what -std= flags are passed to ${CC} in the Makefile, since the implementation is predicated by whether or not it’s C++ or __STDC__ is defined. There might be an update that we can grab from NetBSD (since the macro originated there).
>         I don’t understand [right now] why the (+foo) form is used *shrugs*.

Yeah, unsure.  Aesthetically it mirrors the declaration for the macros
with negative values such as LDBL_MIN_EXP (where the parentheses do have
a functional purpose), but in sys/*/include/{_limits.h,_stdint.h} by
comparison we don't have parens around the positive values.

Anyway maybe the macro pasting method is just too fragile of a hack.


More information about the svn-src-head mailing list