Discussion:
[ast-developers] [ast-users] print -v compound does not report -s for a member declared with typeset -s -E
David Korn
2013-08-07 15:35:48 UTC
Permalink
cc: wendlin1974 at gmail.com
Subject: Re: [ast-users] print -v compound does not report -s for a member declared with typeset -s -E
--------
I may have found a bug in print -v: If I declare a short floating
ksh -c 'function f { compound c=( float a=1 ; typeset -s -E b=2 ) ; ((
c.a+=c.b )) ;print -v c ; } ; f'
(
typeset -l -E a=3
typeset -E b=2
)
typeset -E b=2 should be typeset -s -E b=2
A patch for this would be welcome
Wendy
Here is a patch:
==============cut here===========================
--- old/data/options.c Fri Jul 6 10:38:58 2012
+++ new/data/options.c Wed Aug 7 10:02:08 2013
@@ -106,6 +106,7 @@
{"-ttagged", NV_TAGGED},
{"-Aassociative array", NV_ARRAY},
{"-aindexed array", NV_ARRAY},
+ {"-sshort", (NV_DOUBLE|NV_SHORT)},
{"-llong", (NV_DOUBLE|NV_LONG)},
{"-Eexponential",(NV_DOUBLE|NV_EXPNOTE)},
{"-Xhexfloat", (NV_DOUBLE|NV_HEXFLOAT)},
==============cut here===========================

David Korn
dgk at research.att.com
Wendy Lin
2013-08-07 15:49:50 UTC
Permalink
Post by David Korn
cc: wendlin1974 at gmail.com
Subject: Re: [ast-users] print -v compound does not report -s for a member declared with typeset -s -E
--------
I may have found a bug in print -v: If I declare a short floating
ksh -c 'function f { compound c=( float a=1 ; typeset -s -E b=2 ) ; ((
c.a+=c.b )) ;print -v c ; } ; f'
(
typeset -l -E a=3
typeset -E b=2
)
typeset -E b=2 should be typeset -s -E b=2
A patch for this would be welcome
Wendy
==============cut here===========================
--- old/data/options.c Fri Jul 6 10:38:58 2012
+++ new/data/options.c Wed Aug 7 10:02:08 2013
@@ -106,6 +106,7 @@
{"-ttagged", NV_TAGGED},
{"-Aassociative array", NV_ARRAY},
{"-aindexed array", NV_ARRAY},
+ {"-sshort", (NV_DOUBLE|NV_SHORT)},
{"-llong", (NV_DOUBLE|NV_LONG)},
{"-Eexponential",(NV_DOUBLE|NV_EXPNOTE)},
{"-Xhexfloat", (NV_DOUBLE|NV_HEXFLOAT)},
==============cut here===========================
Thank you. I will test it.

Wendy

Loading...