[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ksh (pdksh) bug
On Fri, 2 Apr 2004, Arkadiusz Miskiewicz wrote:
> It seems that current /bin/sh on openbsd (pdksh) has one bug in evaluation of
> expressions support. It doesn't support hexadecimal values.
> I'm not using OpenBSD but I asked one guy to do testing:
> $ /bin/sh
> $ echo $((0xff))
> /bin/sh: 0xff: bad number `0xff'
> # uname -a
> OpenBSD testes.xx.xx 3.4 jpillati#0 i386
> SUSv3 says
> ,,Only the decimal-constant, octal-constant, and hexadecimal-constant
> constants specified in the ISO C standard, Section 188.8.131.52 are required to be
> recognized as constants.''
Yes, our sh seems to do this wrong. Will try to look into this.
> Also it seem to overflow:
> $ echo $((16#ffffffff))
Well, sh is supposed to do signed arithmetic following C rules, so
16#ffffffff == -1 is ok, i think.