On 10/24/20 11:05 AM, Robert Elz via austin-group-l at The Open Group wrote:
It might be useful to know what the printf utility (the one
from the filesystem) outputs for
        /path/to/printf '%d\n' 0xffffc00000000000
on Solaris, AIX, HPUX, Linux, MacOS, and anything else
similar anyone can test that on.   If you get
        18446673704965373952
and no error message, then please try with more 0's appended
to actually force overflow to happen.

On Solaris 11.4:

% /usr/bin/printf '%d\n' 0xffffc00000000000
printf: 0xffffc00000000000: Result too large
-1

% /usr/gnu/bin/printf '%d\n' 0xffffc00000000000
printf: ‘0xffffc00000000000’: Result too large
9223372036854775807

(Same results on both SPARC & x86. 64-bit binaries on both.)

--
        -Alan Coopersmith-               alan.coopersm...@oracle.com
         Oracle Solaris Engineering - https://blogs.oracle.com/alanc

Reply via email to