From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21288 invoked by alias); 1 Aug 2013 12:50:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 21260 invoked by uid 89); 1 Aug 2013 12:50:33 -0000 X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mail-ea0-f171.google.com) (209.85.215.171) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 01 Aug 2013 12:50:32 +0000 Received: by mail-ea0-f171.google.com with SMTP id n15so975387ead.16 for ; Thu, 01 Aug 2013 05:50:24 -0700 (PDT) X-Received: by 10.15.81.136 with SMTP id x8mr1405920eey.4.1375361424098; Thu, 01 Aug 2013 05:50:24 -0700 (PDT) Received: from s42.loc (91-119-128-234.dynamic.xdsl-line.inode.at. [91.119.128.234]) by mx.google.com with ESMTPSA id bj46sm4102719eeb.13.2013.08.01.05.50.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 01 Aug 2013 05:50:23 -0700 (PDT) Received: from cow by s42.loc with local (Exim 4.80) (envelope-from ) id 1V4sKj-0005Vp-Nl; Thu, 01 Aug 2013 14:50:21 +0200 From: Bernhard Reutner-Fischer To: gcc-patches@gcc.gnu.org Cc: Bernhard Reutner-Fischer , Ian Lance Taylor , gofrontend-dev@googlegroups.com Subject: [libgo PATCH 0/1] mksyscalls.awk: make split ERE more portable Date: Thu, 01 Aug 2013 12:50:00 -0000 Message-Id: <1375360588-20819-1-git-send-email-rep.dot.nop@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="H+4ONPRPur6+Ovig" Content-Disposition: inline X-Mutt-Fcc: ~/sent X-Virus-Found: No X-IsSubscribed: yes X-SW-Source: 2013-08/txt/msg00022.txt.bz2 --H+4ONPRPur6+Ovig Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 413 Hi, When using busybox' awk to bootstrap, libgo's syscalls are generated incorrectly. I'm attaching the split() used by busybox' awk including output before and after the patch for reference. Please install / ok to install? Bernhard Reutner-Fischer (1): mksyscalls.awk: make split ERE more portable libgo/go/syscall/mksyscall.awk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.7.10.4 --H+4ONPRPur6+Ovig Content-Type: text/x-csrc; charset=us-ascii Content-Disposition: attachment; filename="regexec.c" Content-length: 1318 #include #include #include int main(void) { int l, n = 0; char *inp = "//sysnb pipe(p *[2]_C_int) (err error)"; char *out = __builtin_alloca(strlen(inp)*2+3); regex_t re; regmatch_t m[1]; strcpy(out, inp); #ifndef ERE # define ERE "[ (]*" #endif if (regcomp(&re, ERE, REG_EXTENDED) != 0) __builtin_abort(); do { l = strcspn(inp, "\n\0"); if (regexec(&re, inp, 1, m, 0) == 0 && m[0].rm_so <= l) { l = m[0].rm_so; if (m[0].rm_eo == 0) m[0].rm_eo++, l++; n++; } else { m[0].rm_eo = l; if (inp[l]) m[0].rm_eo++; } memcpy(out, inp, l); do { out[l] = '\0'; } while (++l < m[0].rm_eo); printf("[%2d] '%s'\n", n, out); while (*(out++) != '\0') continue; inp += m[0].rm_eo; } while (*inp); regfree(&re); return 0; } #if 0 + gcc '-DERE="[ (]*"' -o x regexec.c + ./x [ 1] '/' [ 2] '/' [ 3] 's' [ 4] 'y' [ 5] 's' [ 6] 'n' [ 7] 'b' [ 8] '' [ 9] 'p' [10] 'i' [11] 'p' [12] 'e' [13] '' [14] 'p' [15] '' [16] '*' [17] '[' [18] '2' [19] ']' [20] '_' [21] 'C' [22] '_' [23] 'i' [24] 'n' [25] 't' [26] ')' [27] '' [28] 'e' [29] 'r' [30] 'r' [31] '' [32] 'e' [33] 'r' [34] 'r' [35] 'o' [36] 'r' [37] ')' + gcc '-DERE="[ (]"' -o x regexec.c + ./x [ 1] '//sysnb' [ 2] 'pipe' [ 3] 'p' [ 4] '*[2]_C_int)' [ 5] '' [ 6] 'err' [ 6] 'error)' #endif --H+4ONPRPur6+Ovig--