[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make test errata
From: |
Chet Ramey |
Subject: |
Re: make test errata |
Date: |
Wed, 18 Dec 2024 14:36:21 -0500 |
User-agent: |
Mozilla Thunderbird |
On 12/14/24 6:18 AM, Martin D Kealey wrote:
I'm trying to make sure that my modified version of Bash passes all the
tests, and in the process I'm finding some, erm, oddities.
Firstly, what seems to be a bug:
Looking in tests/printf7.sub it has
INT_MAX=$(getconf INT_MAX 2>/dev/null)
[ -z "$INT_MAX" ] && INT_MAX=2147483647 # assume 32 bits
TOOBIG=$(( $INT_MAX * 10 ))
On systems where "int" and "long" are the same underlying type, this will
simply set TOOBIG=-10, which then *doesn't* cause most of the intended
failures.
Bash doesn't use `long' for arithmetic; it uses intmax_t. Systems that have
sizeof(int) == sizeof(long) == sizeof(intmax_t) == 4 are rare.
But I like your suggestion to avoid a multiply.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/