delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/10/03/00:59:31

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; q=dns; s=default; b=b7Y
buK52ebf0msFyTOtK2Ne9x5t6xkB6pA1Z1/ZgzPVDwFMXIDT9aNehTAUXswI2IRT
O9wr8H/zr7AvNFI6fYer/Nmeu7LA+yQn+/qh9Yi781rsI9tTWHwFcRl8UXa12DZc
6X8tjOmv5dyD2dZdKRj5xQC/Wy9lN9HoZnE8rZHw=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; s=default; bh=OEeDEjfTA
ygNbxVrmfdTNvS1Fl8=; b=LDpVAtiabEqOrc/Mvi3mZkMYhIBZBI0/m89d43ZYm
tIKPdWEVtGV5wiSkXSIm4FmEqFqcbgGMJ9hiZy1RTSTnPDg3c5OivArQK8y5CLvx
/HecsEO1dgE+7NKPerYjXNuFIGWm/5hWhfzqTF+wmO7TTWyv5wZ24hNcsI/D18Q3
Ks=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: mga02.intel.com
X-ExtLoop1: 1
From: "Westlund, John A" <john DOT a DOT westlund AT intel DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: gawk 4.1.3: warning: gensub: third argument
Date: Sat, 3 Oct 2015 04:59:07 +0000
Message-ID: <7134EBD742DCBF41BAF3EF2F123CCC6C0AA96A70@ORSMSX101.amr.corp.intel.com>
MIME-Version: 1.0
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t934xQRI026463

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

John

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019