From: arr Date: Sat, 28 Apr 2018 07:18:03 +0000 (-0700) Subject: The MSVC x86_64 compiler defines long as 32-bits. X-Git-Url: http://git.subgeniuskitty.com/pforth/.git/commitdiff_plain/58a4c23bbd72fd0fde36266e8c9faa4e199d1232?hp=529bb4e23b94186596ca0e3f5d295b0be95d4fad The MSVC x86_64 compiler defines long as 32-bits. This means '1L' is 32-bits and a 62 bit shift on a 32-bit value is UB which resulted in a 0 for the FP_DHI1 value. --- diff --git a/csrc/pfinnrfp.h b/csrc/pfinnrfp.h index ec476f7..23b379b 100644 --- a/csrc/pfinnrfp.h +++ b/csrc/pfinnrfp.h @@ -23,7 +23,7 @@ #ifdef PF_SUPPORT_FP -#define FP_DHI1 (((PF_FLOAT)(1L<<(sizeof(cell_t)*8-2)))*4.0) +#define FP_DHI1 (((PF_FLOAT)((cell_t)1<<(sizeof(cell_t)*8-2)))*4.0) case ID_FP_D_TO_F: /* ( dlo dhi -- ) ( F: -- r ) */ PUSH_FP_TOS;