One: we're working with unitialised variables. What do the standards
actually say about this? (I will be looking this up).
POSIX doesn't say anything about the integer attribute and doesn't require the
pre/post increment operators. However:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html#tag_17_01_02_01
"All variables shall be initialized to zero if they are not otherwise assigned
by the input to the application."
That's rather vague wording from section 1.1, "Relation to other
documents". Vague, as the POSIX shell has no concept of integers.
Not to mention consistency with the rest of the language and all the other
implementations.
Two: The regression appears to be constrained to 'typeset -p', which I'm
unlikely to use in a script.
Interesting. I don't usually use it in scripts either but it's invaluable for
testing/debugging IMO. print -C (or printf '%#B') is also affected (which is
much more useful in scripts):
$ ksh <<\EOF
> integer -a arr
> ((arr[3]++))
> printf "<%s> " "$(print -v arr[3])" "$(print -C arr)" "$(typeset -p arr)"
"${arr[3]}" $((arr[3]))
> echo
> EOF
<1> <> <typeset -a -l -i arr=()> <1> <1>
I found similar issues with print [-v | -C].
It looks like that part of print shares code with typeset -p. Something
to do with discovering the contents of a non-simple variable.
Definitely present since January (the last ast download I've got here).
Cheers,
Henk
_______________________________________________
ast-developers mailing list
ast-developers@lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers