[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gawk printf format problem with negative numbers
From: |
Paul Eggert |
Subject: |
Re: gawk printf format problem with negative numbers |
Date: |
28 Oct 2003 13:29:18 -0800 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
"Shaffer, Kenneth" <address@hidden> writes:
> #define INTMAX_MIN (-9223372036854775808)
That is the bug. 9223372036854775808 cannot be represented as a long
long, so its type is unsigned long long. -9223372036854775808
therefore evaluates to 9223372036854775808ULL, which is not a negative
value.
Here is a corrected definition:
#define INTMAX_MIN (-1 - 9223372036854775807)
Did your INTMAX_MIN come from a GCC-supplied header, or from a
glibc-supplied header, or from some other source? The bug does not
exist in my copy of gcc or glibc. I don't use Cygwin, though.
Can you please get Cygwin fixed by filing a bug report etc.? This fix
should be made regardless of what Gawk does. More and more programs
are using INTMAX_MIN, and are expecting it to work as the C standard
requires. I'd rather not have to worry about porting around this
Cygwin bug.
Thanks.
- gawk printf format problem with negative numbers, Shaffer, Kenneth, 2003/10/28
- Re: gawk printf format problem with negative numbers, Aharon Robbins, 2003/10/28
- RE: gawk printf format problem with negative numbers, Shaffer, Kenneth, 2003/10/28
- RE: gawk printf format problem with negative numbers, Shaffer, Kenneth, 2003/10/28
- RE: gawk printf format problem with negative numbers, Shaffer, Kenneth, 2003/10/28
- Re: gawk printf format problem with negative numbers,
Paul Eggert <=
- RE: gawk printf format problem with negative numbers, Shaffer, Kenneth, 2003/10/28
- RE: gawk printf format problem with negative numbers, Shaffer, Kenneth, 2003/10/29