gawk 4.1.3: warning: gensub: third argument

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Oct 21 10:17:00 GMT 2015


On Oct  3 04:59, Westlund, John A wrote:
> I first noticed this issue after an update to gawk 4.1.3. If the third argument in a call to gensub is bogus a warning is generated where is used to silently pass through:
> 
> $ echo asdf  | gawk '{print gensub(/a/,"b","")}'
> gawk: cmd. line:1: (FILENAME=- FNR=1) warning: gensub: third argument `' treated as 1
> bsdf
> $ gawk -V
> GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.3, GNU MP 6.0.0)
> Copyright (C) 1989, 1991-2015 Free Software Foundation.
> 
> On other gawk versions this is the behavior:
> $ echo asdf | gawk '{print gensub(/a/,"b","")}'
> Bsdf
> 
> Appears to be resolved by this patch:
> https://www.sourceware.org/ml/libc-alpha/2015-08/msg00269.html

No, that's a patch in glibc to cope with the changed behaviour of gawk
4.1.3.  The upstream change was intentional.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20151021/1659651c/attachment.sig>


More information about the Cygwin mailing list