On Mon, Jun 11, 2001 at 05:41:25PM -0500, Ken Williams wrote:
> [EMAIL PROTECTED] (Nicholas Clark) wrote:
> >Please could you send the output of this revised test program:
> >
> >#include "EXTERN.h"
> >#include "perl.h"
> >int main (void) {
> > double a = I32_MIN;
> > char buffer[256];
> > puts ("I32_MIN='"STRINGIFY(I32_MIN)"'");
> > sprintf (buffer, "I32_MIN=%g", a);
> > puts (buffer);
> > return 0;
> >}
> >I get
> > ./testit
> >I32_MIN='(-2147483647-1)'
> >I32_MIN=-2.14748e+09
^ Minus
>
> Okay, I get
>
> % cc -o testprogram testprogram.c
> testprogram.c: In function `main':
> testprogram.c:4: warning: decimal constant is so large that it is unsigned
> % ./testprogram
> I32_MIN='-2147483648'
> I32_MIN=2.14748e+09
>
> so it looks like we're okay?
Erk No.
Darwin's gcc seems to be broken, in that it thinks that -2147483648
is a positive number.
I've got to go to be [work in the morning. :-(] but I think that finding
some way to force I32_MIN and IV_Min to be defined as -2147483647-1
should solve this bug, and may well make other things less unhappy.
[although that SEGV might also need to be solved first before the benefits
of IV_MIN being less than zero become apparent]
Nicholas Clark