diff options
author | Paul Green <Paul.Green@stratus.com> | 2004-01-15 11:00:15 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-01-17 22:00:48 +0000 |
commit | 8f8d40ab34e002001c7e6f500a987fa1dfb3bd78 (patch) | |
tree | b2032d9a55fde4bc9cf483320b1848bbf6f3005e /pp_pack.c | |
parent | bac662eeb2cdce47175319fe613f5779e780f517 (diff) | |
download | perl-8f8d40ab34e002001c7e6f500a987fa1dfb3bd78.tar.gz |
Refactor VOS patches for bleadperl and perl-5.8.x
From: "Green, Paul" <Paul.Green@stratus.com>
Message-ID: <A2A34F15EE916148BC4C4748223E67A4069FBB15@exna4.stratus.com>
p4raw-id: //depot/perl@22171
Diffstat (limited to 'pp_pack.c')
-rw-r--r-- | pp_pack.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -2429,11 +2429,17 @@ S_pack_rec(pTHX_ SV *cat, register tempsym_t* symptr, register SV **beglist, SV given 10**(NV_MAX_10_EXP+1) == 128 ** x solve for x: x = (NV_MAX_10_EXP+1) * log (10) / log (128) And with that many bytes only Inf can overflow. + Some C compilers are strict about integral constant + expressions so we conservatively divide by a slightly + smaller integer instead of multiplying by the exact + floating-point value. */ #ifdef NV_MAX_10_EXP - char buf[1 + (int)((NV_MAX_10_EXP + 1) * 0.47456)]; +/* char buf[1 + (int)((NV_MAX_10_EXP + 1) * 0.47456)]; -- invalid C */ + char buf[1 + (int)((NV_MAX_10_EXP + 1) / 2)]; /* valid C */ #else - char buf[1 + (int)((308 + 1) * 0.47456)]; +/* char buf[1 + (int)((308 + 1) * 0.47456)]; -- invalid C */ + char buf[1 + (int)((308 + 1) / 2)]; /* valid C */ #endif char *in = buf + sizeof(buf); |