This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Configure: add note about nvsize sometimes lying
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 2 Mar 2015 12:00:33 +0000 (07:00 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 2 Mar 2015 12:31:24 +0000 (07:31 -0500)
Lying in case you expect that many bytes being used for NV.

Porting/Glossary
config_h.SH

index 75f67e3..3f9057e 100644 (file)
@@ -4086,7 +4086,8 @@ longdblkind (d_longdbl.U):
 longdblsize (d_longdbl.U):
        This variable contains the value of the LONG_DOUBLESIZE symbol, which
        indicates to the C program how many bytes there are in a long double,
-       if this system supports long doubles.
+       if this system supports long doubles.  Note that this is
+       sizeof(long double), which may include unused bytes.
 
 longlongsize (d_longlong.U):
        This variable contains the value of the LONGLONGSIZE symbol, which
@@ -4351,7 +4352,8 @@ nvGUformat (perlxvf.U):
        a Perl NV using %G-ish floating point format.
 
 nvsize (perlxv.U):
-       This variable is the size of an NV in bytes.
+       This variable is the size of a Perl NV in bytes.
+       Note that some floating point formats have unused bytes.
 
 nvtype (perlxv.U):
        This variable contains the C type used for Perl's NV.
index 03c6753..fb2224e 100755 (executable)
@@ -1952,7 +1952,8 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
 /* LONG_DOUBLESIZE:
  *     This symbol contains the size of a long double, so that the
  *     C preprocessor can make decisions based on it.  It is only
- *     defined if the system supports long doubles.
+ *     defined if the system supports long doubles.   Note that this
+ *     is sizeof(long double), which may include unused bytes.
  */
 /* HAS_LDEXPL:
  *     This symbol, if defined, indicates that the ldexpl routine is
@@ -4912,6 +4913,11 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
  */
 /* NVSIZE:
  *     This symbol contains the sizeof(NV).
+ *     Note that some floating point formats have unused bytes.
+ *     The most notable example is the x86* 80-bit extended precision
+ *     which comes in byte sizes of 12 and 16 (for 32 and 64 bit
+ *     platforms, respectively), but which only uses 10 bytes.
+ *     Perl compiled with -Duselongdouble on x86* is like this.
  */
 /* NV_PRESERVES_UV:
  *     This symbol, if defined, indicates that a variable of type NVTYPE