On 7/26/23 4:18 PM, tho...@habets.se wrote:

Bash Version: 5.2
Patch Level: 15
Release Status: release

Description:
         printf '%d\n' 111111111111111111111111111 && echo success
         prints "success"
         /usr/bin/printf does not, but instead returns EXIT_FAILURE (1).

The bash printf builtin doesn't consider this an error -- it prints a
warning -- because strtoimax completely converts the argument (*ep == 0)
even as it changes errno to ERANGE. That dates back to bash-2.05b.

I can make ERANGE overflow a conversion error as well; that seems
consistent with POSIX and what other shells do.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/


Reply via email to