On Mon, Jun 11, 2001 at 04:14:17PM -0500, Ken Williams wrote:
> [EMAIL PROTECTED] (Nicholas Clark) wrote:
> >On Mon, Jun 11, 2001 at 03:41:57PM -0500, Jarkko Hietaniemi wrote:
> >> > util.c: In function `Perl_cast_ulong':
> >> > util.c:2936: warning: decimal constant is so large that it is unsigned
> >> > util.c:2936: warning: decimal constant is so large that it is unsigned
> >> > util.c: In function `Perl_cast_i32':
> >> > util.c:2954: warning: decimal constant is so large that it is unsigned
> >> > util.c:2954: warning: decimal constant is so large that it is unsigned
> >> 
> >> Hmm, I wonder why no other gccs seem to care?  What's the version of gcc?
> >
> >It's I32_MIN and IV_MIN it's complaining about. This would be a bad thing.

> I see this on OS X:
> 
>   [localhost:~/Downloads/perl] ken% ./testprogram
>   I32_MIN='-2147483648'

Thanks. That doesn't look like a positive number (which is what I feared)
There shouldn't be a problem *as long as* only that warning from gcc is
broken. if the warning is non broken because gcc is actually treating
-2147483648 as a large positive number then things are going to go wrong.
[if it is, I guess we con gcc by making sure I32_MIN ends up by being
defined as -2147483647-1]

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;
}

[It's convoluted as printf is #defined as PerlIO, but puts and sprintf don't
sem to be affected]

I get
 ./testit 
I32_MIN='(-2147483647-1)'
I32_MIN=-2.14748e+09

Nicholas Clark

Reply via email to