|
From: | Shaffer, Kenneth |
Subject: | RE: gawk printf format problem with negative numbers |
Date: | Tue, 28 Oct 2003 16:05:10 -0500 |
shaffek>make tstmin
gcc tstmin.c -o tstmin
tstmin.c:6:16: warning: integer constant is so large that it is unsigned
tstmin.c: In function `main':
tstmin.c:6: warning: this decimal constant is unsigned only in ISO C90
tstmin.c:6: warning: integer constant is too large for "long" type
/usr/src
shaffek>./tstmin
This compiler is buggy
#define INTMAX_MIN (-9223372036854775808)
#define INTMAX_MAX (9223372036854775807)
#define UINTMAX_MAX (18446744073709551615ULL)
The above must be 64-bit values. Does gcc handle such large values on a PC? If so, would you happen to know what compile options might make use of it?
--
Ken Shaffer
Staff Software Engineer
770-236-3421
address@hidden
-----Original Message-----
> The crux of the problem is the compare "if (tmpval < INTMAX_MIN)"... it thinks
> -1234 is less than the maximum negative number
What is the value of INTMAX_MIN on your host? Can you reproduce the problem
with a small C program? Something like this:
#include <stdio.h>
#include <inttypes.h>
double tmpval = -1234;
int main (void)
{
if (tmpval < INTMAX_MIN)
printf ("This compiler is buggy\n");
}
[Prev in Thread] | Current Thread | [Next in Thread] |