bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: gawk printf format problem with negative numbers


From: Shaffer, Kenneth
Subject: RE: gawk printf format problem with negative numbers
Date: Tue, 28 Oct 2003 16:19:37 -0500

The stdint.h is broke:  needs LL on the end tacked on the end of several values:

line 74:
#define INT64_MIN (-9223372036854775808)

line 79:
#define INT64_MAX (9223372036854775807)

line 91:
#define INT_LEAST64_MIN (-9223372036854775808)

line 96:
#define INT_LEAST64_MAX (9223372036854775807)

line 108:
#define INT_FAST64_MIN (-9223372036854775808)

line 113:
#define INT_FAST64_MAX (9223372036854775807)

lines 128 and 129:
#define INTMAX_MIN (-9223372036854775808)
#define INTMAX_MAX (9223372036854775807)

Probably not a problem on normal unix flavors of this header file.  Thanks for helping me narrow this down. After making the above changes and recompiling gawk, it returns the correct result.

--
Ken Shaffer
Staff Software Engineer
770-236-3421
address@hidden
 
 


-----Original Message-----
From: Shaffer, Kenneth
Sent: Tuesday, October 28, 2003 4:05 PM
To: 'Paul Eggert'; Shaffer, Kenneth
Cc: 'address@hidden'
Subject: RE: gawk printf format problem with negative numbers


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



- - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - -
This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]