bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk: "please file a bug report"


From: J Naman
Subject: Re: gawk: "please file a bug report"
Date: Sun, 5 Sep 2021 14:00:15 -0400

Looks like the problem is the number type, not the array. I experimented
with Deni's example and narrowed it down:
v = "" A[ i ]; # coerce number to string, then: no error
#add new lines:
n=2;   gensub( /^/, "1", 1, n ) # generates the warning
print "typeof(n) " typeof(n) " after gensub n= " n
# output: 'typeof(n) "unknown" after gensub n= 2'   # (still 2, but not a
number?)
So, Gawk might check the gensub() 'target' for not-a-string ...
-john naman

On Sun, Sep 5, 2021 at 6:38 AM Denis Shirokov <cosmogen@gmail.com> wrote:

> Hello gawk team
>
> I finally managed to set aside some time to investigate the typeof ()
> built-in function problem.
>
> I am attaching a script to reproduce the problem. and in my opinion
> this is an extremely strange bug. how the gensub/gsub/sub functions,
> when working with a local variable, can affect the contents of the
> array A, which is not even passed to it as a parameter, I really don’t
> have any idea about it.
>
> however - error will  not reproduce if for-in cycle will be located in
> BEGIN area
>
> with the Best Regards and Respect
>
> Denis Shirokov
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]