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



- - - - - - - 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]