On 6/29/23 5:45 AM, Denys Vlasenko wrote:
Good day.

IIRC bash used to allow numeric constants of the
BASE#DIGITS form even if the DIGITS part was empty.
IOW: not only "64#0", but "64#" too was accepted
as a valid zero constant.

Yes, that was clearly wrong, and it changed in bash-5.1.

However, a somewhat similar situation with hex prefix,
0xDIGITS, still allows just "0x" as a valid zero constant.

That's clearly invalid as well. It violates the C standard, and POSIX
disallows it. No other shell treats it as valid. I suppose we could call
it an extension, but it's hard to see how it's useful.

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