From owner-freebsd-standards@FreeBSD.ORG Mon Jun 2 13:14:32 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2351E37B404 for ; Mon, 2 Jun 2003 13:14:31 -0700 (PDT) Received: from bremen.shuttle.de (bremen.shuttle.de [194.95.249.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CD7943F85 for ; Mon, 2 Jun 2003 13:14:30 -0700 (PDT) (envelope-from schweikh@schweikhardt.net) Received: from bremen.shuttle.de (localhost [127.0.0.1]) by bremen.shuttle.de (Postfix) with ESMTP id AD17517D2D for ; Mon, 2 Jun 2003 22:14:28 +0200 (CEST) Received: (from uucp@localhost)h52KES8i004400 for standards@freebsd.org; Mon, 2 Jun 2003 22:14:28 +0200 Received: (from schweikh@localhost) by hal9000.schweikhardt.net (8.12.9/8.12.9) id h52KEjRa004112 for standards@freebsd.org; Mon, 2 Jun 2003 22:14:45 +0200 (CEST) (envelope-from schweikh) Date: Mon, 2 Jun 2003 22:14:45 +0200 From: Jens Schweikhardt To: standards@freebsd.org Message-ID: <20030602201445.GA3650@schweikhardt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: shell arithmetic not POSIX compliant X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2003 20:14:32 -0000 hello, world\n while trying to configure the POSIX validation suite from the OpenGroup (VSC-lite) I ran into the following problem. During test script generation the following syntax appears in a shell script: : $((tet_l31_testnum += $#)) where tet_l31_testnum is the name of a variable with an integer value and $# is 1. Our /bin/sh complains about /home/vsctest1/tet_root/lib/posix_sh/tcm.sh: arith: syntax error: "tet_l31_testnum += 1" This begs the question is our shell's arithmetic substandard or is the bug in the script? I'm inclined to say it is a bug in our /bin/sh, reading the POSIX 2001 sh spec, which refers to the C operators table and makes these exceptions The arithmetic expression shall be processed according to the rules given in Arithmetic Precision and Operations , with the following exceptions: * Only signed long integer arithmetic is required. * Only the decimal-constant, octal-constant, and hexadecimal-constant constants specified in the ISO C standard, Section 6.4.4.1 are required to be recognized as constants. * The sizeof() operator and the prefix and postfix "++" and "--" operators are not required. * Selection, iteration, and jump statements are not supported. So it appears all assignment ops like += must be supported. Regards, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped) From owner-freebsd-standards@FreeBSD.ORG Tue Jun 3 07:42:28 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E87D537B401 for ; Tue, 3 Jun 2003 07:42:28 -0700 (PDT) Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [193.201.200.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F10A43FBD for ; Tue, 3 Jun 2003 07:42:25 -0700 (PDT) (envelope-from fanf@chiark.greenend.org.uk) Received: by chiark.greenend.org.uk (Debian Exim 3.35 #1) with local for freebsd-standards@freebsd.org id 19NCzZ-0001qc-00; Tue, 03 Jun 2003 15:42:25 +0100 Date: Tue, 3 Jun 2003 15:42:25 +0100 From: Tony Finch To: freebsd-standards@freebsd.org Message-ID: <20030603144225.GH18938@chiark.greenend.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i Sender: Tony Finch Subject: Sed substitution bugs X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2003 14:42:29 -0000 $ echo foo | sed 's/ */,/g' ,f,o,o $ On Solaris and Linux I get ,f,o,o, (which is what I expected). The following work correctly: $ echo | sed 's/ */,/g' , $ echo foo | sed 's/ *$/,/g' foo, $ Here's another (related) bug: $ echo foo | sed 's/ */,/1' ,foo $ echo foo | sed 's/ */,/2' ,foo $ echo foo | sed 's/ */,/3' ,foo $ echo foo | sed 's/ */,/4' ,foo $ echo foo | sed 's/ */,/5' ,foo $ Tony. -- f.a.n.finch http://dotat.at/ LUNDY FASTNET IRISH SEA: SOUTHEAST VEERING SOUTHWEST 5 TO 7, OCCASIONALLY GALE 8 AT FIRST, DECREASING 4 OR 5. RAIN. MODERATE OR GOOD. From owner-freebsd-standards@FreeBSD.ORG Tue Jun 3 08:19:27 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 24D8837B401; Tue, 3 Jun 2003 08:19:27 -0700 (PDT) Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [193.201.200.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C66043F85; Tue, 3 Jun 2003 08:19:26 -0700 (PDT) (envelope-from fanf@chiark.greenend.org.uk) Received: by chiark.greenend.org.uk (Debian Exim 3.35 #1) with local id 19NDZN-0004WU-00; Tue, 03 Jun 2003 16:19:25 +0100 Date: Tue, 3 Jun 2003 16:19:25 +0100 From: Tony Finch To: freebsd-standards@freebsd.org, tjr@freebsd.org Message-ID: <20030603151925.GI18938@chiark.greenend.org.uk> References: <20030603144225.GH18938@chiark.greenend.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030603144225.GH18938@chiark.greenend.org.uk> User-Agent: Mutt/1.3.28i Sender: Tony Finch Subject: [PATCH] for review Re: Sed substitution bugs X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2003 15:19:27 -0000 On Tue, Jun 03, 2003 at 03:42:25PM +0100, Tony Finch wrote: > $ echo foo | sed 's/ */,/g' > ,f,o,o > $ echo foo | sed 's/ */,/3' > ,foo > $ echo foo | sed 's/ */,/4' > ,foo > $ echo foo | sed 's/ */,/5' > ,foo > $ $ echo foo | ./sed 's/ */,/g' ,f,o,o, $ echo foo | ./sed 's/ */,/3' fo,o $ echo foo | ./sed 's/ */,/4' foo, $ echo foo | ./sed 's/ */,/5' foo $ --- process.c 20 Sep 2002 19:40:23 -0000 1.29 +++ process.c 3 Jun 2003 15:11:47 -0000 @@ -323,7 +323,7 @@ { SPACE tspace; regex_t *re; - size_t re_off, slen; + regoff_t re_off, slen; int lastempty, n; char *s; @@ -361,9 +361,6 @@ s += match[0].rm_eo; slen -= match[0].rm_eo; lastempty = 0; - } else if (match[0].rm_so == slen) { - s += match[0].rm_so; - slen = 0; } else { if (match[0].rm_so == 0) cspace(&SS, s, match[0].rm_so + 1, @@ -375,15 +372,19 @@ slen -= match[0].rm_so + 1; lastempty = 1; } - } while (slen > 0 && regexec_e(re, s, REG_NOTBOL, 0, slen)); + } while (slen >= 0 && regexec_e(re, s, REG_NOTBOL, 0, slen)); /* Copy trailing retained string. */ if (slen > 0) cspace(&SS, s, slen, APPEND); break; default: /* Nth occurrence */ while (--n) { + if (match[0].rm_eo == match[0].rm_so) + match[0].rm_eo = match[0].rm_so + 1; s += match[0].rm_eo; slen -= match[0].rm_eo; + if (slen < 0) + return (0); if (!regexec_e(re, s, REG_NOTBOL, 0, slen)) return (0); } Tony. -- f.a.n.finch http://dotat.at/ SHANNON: VARIABLE 3 BECOMING SOUTHERLY 5 OR 6. SHOWERS. GOOD. From owner-freebsd-standards@FreeBSD.ORG Tue Jun 3 09:58:06 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CFB0537B401; Tue, 3 Jun 2003 09:58:06 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2AE0743F3F; Tue, 3 Jun 2003 09:58:05 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.9/8.12.9) with ESMTP id h53Gw3Vo004743 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 3 Jun 2003 12:58:04 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.9/8.12.9/Submit) id h53Gw3gE004740; Tue, 3 Jun 2003 12:58:03 -0400 (EDT) (envelope-from wollman) Date: Tue, 3 Jun 2003 12:58:03 -0400 (EDT) From: Garrett Wollman Message-Id: <200306031658.h53Gw3gE004740@khavrinen.lcs.mit.edu> To: Will Andrews In-Reply-To: <200306030452.h534qtZm036403@repoman.freebsd.org> References: <200306030452.h534qtZm036403@repoman.freebsd.org> X-Spam-Score: -19.8 () IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) cc: standards@FreeBSD.org Subject: cvs commit: ports/misc Makefile ports/misc/utftools Makefile distinfo pkg-descr pkg-plist ports/misc/utftools/files patch-Makefile.in patch-expand.c patch-fmt.c patch-unexpand.c patch-wc.c X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2003 16:58:07 -0000 < said: > Log: > Add utftools 1.6, an UTF-aware wc, fmt, expand, and unexpand. This should be entirely unnecessary. When a locale is selected which uses UTF-8, these tools should behave correctly automatically. If they do not, please file a bug report. -GAWollman From owner-freebsd-standards@FreeBSD.ORG Tue Jun 3 11:51:08 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F70537B401; Tue, 3 Jun 2003 11:51:08 -0700 (PDT) Received: from procyon.firepipe.net (procyon.firepipe.net [198.78.66.151]) by mx1.FreeBSD.org (Postfix) with ESMTP id B425443FA3; Tue, 3 Jun 2003 11:51:07 -0700 (PDT) (envelope-from will@csociety.org) Received: by procyon.firepipe.net (Postfix, from userid 1000) id 3A35A20D70; Tue, 3 Jun 2003 11:51:06 -0700 (PDT) Date: Tue, 3 Jun 2003 11:51:06 -0700 From: Will Andrews To: Garrett Wollman Message-ID: <20030603185106.GO81874@procyon.firepipe.net> References: <200306030452.h534qtZm036403@repoman.freebsd.org> <200306031658.h53Gw3gE004740@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200306031658.h53Gw3gE004740@khavrinen.lcs.mit.edu> User-Agent: Mutt/1.4.1i cc: standards@FreeBSD.org cc: Will Andrews Subject: Re: cvs commit: ports/misc Makefile ports/misc/utftools Makefile distinfo pkg-descr pkg-plist ports/misc/utftools/files patch-Makefile.in patch-expand.c patch-fmt.c patch-unexpand.c patch-wc.c X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2003 18:51:08 -0000 On Tue, Jun 03, 2003 at 12:58:03PM -0400, Garrett Wollman wrote: > This should be entirely unnecessary. When a locale is selected which > uses UTF-8, these tools should behave correctly automatically. If > they do not, please file a bug report. Take it up with the port maintainer. Regards, -- wca From owner-freebsd-standards@FreeBSD.ORG Tue Jun 3 14:53:24 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA03237B401 for ; Tue, 3 Jun 2003 14:53:24 -0700 (PDT) Received: from web13403.mail.yahoo.com (web13403.mail.yahoo.com [216.136.175.61]) by mx1.FreeBSD.org (Postfix) with SMTP id 5292643FB1 for ; Tue, 3 Jun 2003 14:53:24 -0700 (PDT) (envelope-from giffunip@yahoo.com) Message-ID: <20030603215322.31853.qmail@web13403.mail.yahoo.com> Received: from [200.91.194.171] by web13403.mail.yahoo.com via HTTP; Tue, 03 Jun 2003 22:53:22 BST Date: Tue, 3 Jun 2003 22:53:22 +0100 (BST) From: "=?iso-8859-1?q?Pedro=20F.=20Giffuni?=" To: freebsd-standards@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: GNU extensions on FreeBSD 5.x headers X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2003 21:53:25 -0000 Hi, JIC you haven't noticed, the latest TenDRA CVS logfile reports: "Unfortunately FreeBSD 5.x uses the GNU C extension __attribute__((__aligned__(x))) in a couple of system headers (, and for i386). To avoid a syntax error __aligned(x) is removed by a #define, but programs that use struct sigcontext, struct savexmm or mcontext_t probably won't work." cheers, Pedro. __________________________________________________ Yahoo! Plus - For a better Internet experience http://uk.promotions.yahoo.com/yplus/yoffer.html From owner-freebsd-standards@FreeBSD.ORG Tue Jun 3 18:19:56 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1CBF637B401 for ; Tue, 3 Jun 2003 18:19:56 -0700 (PDT) Received: from espresso.bsdmike.org (espresso.bsdmike.org [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E8E443F3F for ; Tue, 3 Jun 2003 18:19:55 -0700 (PDT) (envelope-from mike@espresso.bsdmike.org) Received: by espresso.bsdmike.org (Postfix, from userid 1002) id DE36F9C8E; Tue, 3 Jun 2003 21:03:38 -0400 (EDT) Date: Tue, 3 Jun 2003 21:03:38 -0400 From: Mike Barcroft To: "Pedro F. Giffuni" Message-ID: <20030603210338.A70533@espresso.bsdmike.org> References: <20030603215322.31853.qmail@web13403.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030603215322.31853.qmail@web13403.mail.yahoo.com>; from giffunip@yahoo.com on Tue, Jun 03, 2003 at 10:53:22PM +0100 Organization: The FreeBSD Project cc: freebsd-standards@FreeBSD.org Subject: Re: GNU extensions on FreeBSD 5.x headers X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 01:19:56 -0000 Pedro F. Giffuni writes: > Hi, JIC you haven't noticed, the latest TenDRA CVS logfile > reports: > > "Unfortunately FreeBSD 5.x uses the GNU C extension > __attribute__((__aligned__(x))) in a couple of system headers > (, and > for i386). To avoid a syntax error __aligned(x) is removed by a > #define, but programs that use struct sigcontext, struct savexmm > or mcontext_t probably won't work." I think those of us who've played with alternative compilers are aware of this requirement. I'm not sure there's anything we can do about it. If anyone has any tricks to force 128-bit alignment without a 128-bit type in standard C, I'd love to hear it. Best regards, Mike Barcroft From owner-freebsd-standards@FreeBSD.ORG Tue Jun 3 18:30:14 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F3E937B401; Tue, 3 Jun 2003 18:30:14 -0700 (PDT) Received: from espresso.bsdmike.org (espresso.bsdmike.org [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADAF443F3F; Tue, 3 Jun 2003 18:30:13 -0700 (PDT) (envelope-from mike@espresso.bsdmike.org) Received: by espresso.bsdmike.org (Postfix, from userid 1002) id 40DC49C8E; Tue, 3 Jun 2003 21:13:57 -0400 (EDT) Date: Tue, 3 Jun 2003 21:13:57 -0400 From: Mike Barcroft To: Tony Finch Message-ID: <20030603211357.B70533@espresso.bsdmike.org> References: <20030603144225.GH18938@chiark.greenend.org.uk> <20030603151925.GI18938@chiark.greenend.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030603151925.GI18938@chiark.greenend.org.uk>; from dot@dotat.at on Tue, Jun 03, 2003 at 04:19:25PM +0100 Organization: The FreeBSD Project cc: freebsd-standards@freebsd.org cc: tjr@freebsd.org Subject: Re: [PATCH] for review Re: Sed substitution bugs X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 01:30:14 -0000 Tony Finch writes: > On Tue, Jun 03, 2003 at 03:42:25PM +0100, Tony Finch wrote: > > $ echo foo | sed 's/ */,/g' > > ,f,o,o > > $ echo foo | sed 's/ */,/3' > > ,foo > > $ echo foo | sed 's/ */,/4' > > ,foo > > $ echo foo | sed 's/ */,/5' > > ,foo > > $ > > $ echo foo | ./sed 's/ */,/g' > ,f,o,o, > $ echo foo | ./sed 's/ */,/3' > fo,o > $ echo foo | ./sed 's/ */,/4' > foo, > $ echo foo | ./sed 's/ */,/5' > foo > $ Could you add a test case to the regression test in src/tools/regression? Best regards, Mike Barcroft From owner-freebsd-standards@FreeBSD.ORG Tue Jun 3 18:35:38 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97ECA37B404 for ; Tue, 3 Jun 2003 18:35:38 -0700 (PDT) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3A4D43F3F for ; Tue, 3 Jun 2003 18:35:37 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au (203.134.172.104) by smtp01.syd.iprimus.net.au (7.0.015) id 3EDD491800000F38; Wed, 4 Jun 2003 11:35:18 +1000 Received: by dilbert.robbins.dropbear.id.au (Postfix, from userid 1000) id 790ACC90F; Wed, 4 Jun 2003 11:32:29 +1000 (EST) Date: Wed, 4 Jun 2003 11:32:29 +1000 From: Tim Robbins To: Tony Finch Message-ID: <20030604113229.A41800@dilbert.robbins.dropbear.id.au> References: <20030603144225.GH18938@chiark.greenend.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030603144225.GH18938@chiark.greenend.org.uk>; from dot@dotat.at on Tue, Jun 03, 2003 at 03:42:25PM +0100 cc: freebsd-standards@freebsd.org Subject: Re: Sed substitution bugs X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 01:35:39 -0000 On Tue, Jun 03, 2003 at 03:42:25PM +0100, Tony Finch wrote: > $ echo foo | sed 's/ */,/g' > ,f,o,o > $ > > On Solaris and Linux I get ,f,o,o, (which is what I expected). It looks like I may have introduced this bug when I made the semi-dramatic change of making 'sed' not store newlines in the line buffers -- OpenBSD's sed gives the right result. I agree that the current output is wrong and that it should be ",f,o,o,". FWIW, 7th Edition sed gets into an infinite loop on that input. > The following work correctly: > > $ echo | sed 's/ */,/g' > , > $ echo foo | sed 's/ *$/,/g' > foo, > $ > > Here's another (related) bug: I can't claim responsibility for this one :-) But I agree that it looks like a bug. > > $ echo foo | sed 's/ */,/1' > ,foo > $ echo foo | sed 's/ */,/2' > ,foo > $ echo foo | sed 's/ */,/3' > ,foo > $ echo foo | sed 's/ */,/4' > ,foo > $ echo foo | sed 's/ */,/5' > ,foo > $ The patch looks fine, but it isn't obvious to me that the second part (handling the /nnn bits) is correct. It seems to produce the right output though. Tim From owner-freebsd-standards@FreeBSD.ORG Wed Jun 4 01:29:28 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6DDA937B401; Wed, 4 Jun 2003 01:29:28 -0700 (PDT) Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [193.201.200.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3AC043F85; Wed, 4 Jun 2003 01:29:27 -0700 (PDT) (envelope-from fanf@chiark.greenend.org.uk) Received: by chiark.greenend.org.uk (Debian Exim 3.35 #1) with local id 19NTeA-0007FY-00; Wed, 04 Jun 2003 09:29:26 +0100 Date: Wed, 4 Jun 2003 09:29:26 +0100 From: Tony Finch To: Tim Robbins Message-ID: <20030604082926.GL18938@chiark.greenend.org.uk> References: <20030603144225.GH18938@chiark.greenend.org.uk> <20030604113229.A41800@dilbert.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030604113229.A41800@dilbert.robbins.dropbear.id.au> User-Agent: Mutt/1.3.28i Sender: Tony Finch cc: freebsd-standards@freebsd.org Subject: Re: Sed substitution bugs X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 08:29:28 -0000 On Wed, Jun 04, 2003 at 11:32:29AM +1000, Tim Robbins wrote: > > The patch looks fine, but it isn't obvious to me that the second part > (handling the /nnn bits) is correct. It seems to produce the right output > though. The if clause that I added is a counterpart to the rm_so == rm_eo case in the /g code. I'll commit the patch with a regression test. Thanks for looking at it. Tony. -- f.a.n.finch http://dotat.at/ COLWYN BAY TO THE MULL OF GALLOWAY INCLUDING THE ISLE OF MAN: SOUTH BACKING SOUTHEAST 2 OR 3 LOCALLY 4, VEERING SOUTHWEST 4 OR 5 LATER. CLOUDY, PERIOD RAIN THEN SHOWERS, DRY, FAIR LATER. GOOD FALLING MODERATE IN RAIN OR SHOWERS. SLIGHT INCREASING MODERATE. From owner-freebsd-standards@FreeBSD.ORG Wed Jun 4 01:38:22 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7A2737B401; Wed, 4 Jun 2003 01:38:22 -0700 (PDT) Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [193.201.200.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2DDA43F75; Wed, 4 Jun 2003 01:38:21 -0700 (PDT) (envelope-from fanf@chiark.greenend.org.uk) Received: by chiark.greenend.org.uk (Debian Exim 3.35 #1) with local id 19NTmn-0007fy-00; Wed, 04 Jun 2003 09:38:21 +0100 Date: Wed, 4 Jun 2003 09:38:21 +0100 From: Tony Finch To: Mike Barcroft Message-ID: <20030604083821.GM18938@chiark.greenend.org.uk> References: <20030603215322.31853.qmail@web13403.mail.yahoo.com> <20030603210338.A70533@espresso.bsdmike.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030603210338.A70533@espresso.bsdmike.org> User-Agent: Mutt/1.3.28i Sender: Tony Finch cc: "Pedro F. Giffuni" cc: freebsd-standards@FreeBSD.org Subject: Re: GNU extensions on FreeBSD 5.x headers X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 08:38:23 -0000 On Tue, Jun 03, 2003 at 09:03:38PM -0400, Mike Barcroft wrote: > > I think those of us who've played with alternative compilers are aware > of this requirement. I'm not sure there's anything we can do about > it. If anyone has any tricks to force 128-bit alignment without a > 128-bit type in standard C, I'd love to hear it. Not in standard C (since it doesn't allow you to express alignment and padding requirements), but in C-as-she-is-spoke why not insert the necessary padding explicitly? Tony. -- f.a.n.finch http://dotat.at/ FORTIES CROMARTY: SOUTHEASTERLY VEERING SOUTHWESTERLY 4 OR 5. RAIN OR THUNDERY SHOWERS. MODERATE WITH FOG PATCHES, BECOMING GOOD LATER. From owner-freebsd-standards@FreeBSD.ORG Wed Jun 4 03:09:39 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F0F5E37B401; Wed, 4 Jun 2003 03:09:38 -0700 (PDT) Received: from fafoe.dyndns.org (chello212186121237.14.vie.surfer.at [212.186.121.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id 479A843FAF; Wed, 4 Jun 2003 03:09:38 -0700 (PDT) (envelope-from stefan@fafoe.dyndns.org) Received: from wombat.fafoe (wombat.fafoe [192.168.2.102]) by fafoe.dyndns.org (Postfix) with ESMTP id 0CB1840C1; Wed, 4 Jun 2003 12:09:35 +0200 (CEST) Received: by wombat.fafoe (Postfix, from userid 1001) id DCCE1D1; Wed, 4 Jun 2003 12:09:34 +0200 (CEST) Date: Wed, 4 Jun 2003 12:09:34 +0200 From: Stefan Farfeleder To: Tony Finch Message-ID: <20030604100934.GC584@wombat.fafoe> References: <20030603215322.31853.qmail@web13403.mail.yahoo.com> <20030603210338.A70533@espresso.bsdmike.org> <20030604083821.GM18938@chiark.greenend.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030604083821.GM18938@chiark.greenend.org.uk> User-Agent: Mutt/1.5.4i cc: "Pedro F. Giffuni" cc: freebsd-standards@FreeBSD.org cc: Mike Barcroft Subject: Re: GNU extensions on FreeBSD 5.x headers X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 10:09:39 -0000 On Wed, Jun 04, 2003 at 09:38:21AM +0100, Tony Finch wrote: > On Tue, Jun 03, 2003 at 09:03:38PM -0400, Mike Barcroft wrote: > > > > I think those of us who've played with alternative compilers are aware > > of this requirement. I'm not sure there's anything we can do about > > it. If anyone has any tricks to force 128-bit alignment without a > > 128-bit type in standard C, I'd love to hear it. > > Not in standard C (since it doesn't allow you to express alignment and > padding requirements), but in C-as-she-is-spoke why not insert the > necessary padding explicitly? By adding padding to a struct you can only align the offset of a struct member: struct foo { ... char padding[N]; bar aligned; ... }; What you cannot do with padding is to align a non-dynamically allocated object of type struct foo as in: struct foo f; There's no way I can see to guarantee that f.aligned is 128-bit aligned. Regards, Stefan From owner-freebsd-standards@FreeBSD.ORG Wed Jun 4 08:16:00 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 710EB37B401; Wed, 4 Jun 2003 08:16:00 -0700 (PDT) Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [193.201.200.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B34743F85; Wed, 4 Jun 2003 08:15:54 -0700 (PDT) (envelope-from fanf@chiark.greenend.org.uk) Received: by chiark.greenend.org.uk (Debian Exim 3.35 #1) with local id 19NZzV-00025v-00; Wed, 04 Jun 2003 16:15:53 +0100 Date: Wed, 4 Jun 2003 16:15:53 +0100 From: Tony Finch To: Mike Barcroft Message-ID: <20030604151553.GO18938@chiark.greenend.org.uk> References: <20030603144225.GH18938@chiark.greenend.org.uk> <20030603151925.GI18938@chiark.greenend.org.uk> <20030603211357.B70533@espresso.bsdmike.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030603211357.B70533@espresso.bsdmike.org> User-Agent: Mutt/1.3.28i Sender: Tony Finch cc: freebsd-standards@freebsd.org cc: tjr@freebsd.org Subject: Re: [PATCH] for review Re: Sed substitution bugs X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 15:16:00 -0000 On Tue, Jun 03, 2003 at 09:13:57PM -0400, Mike Barcroft wrote: > > Could you add a test case to the regression test in > src/tools/regression? It doesn't pass all the current tests: Running test y --- regress.y.out Fri Jun 28 12:45:00 2002 +++ - Wed Jun 4 15:12:04 2003 @@ -1 +1 @@ -fOO \ No newline at end of file +fOO FAIL: Test y failed: regression detected. See above. (in /FreeBSD/head/tools/regression/usr.bin/sed) This isn't a result of my hacking... Tony. -- f.a.n.finch http://dotat.at/ ARDNAMURCHAN POINT TO CAPE WRATH INCLUDING THE OUTER HEBRIDES: SOUTH BACKING SOUTHEAST 4 OR 5, LATER VEERING SOUTH TO SOUTHWEST 4 OR 5 . DRY, FAIR. BECOMING CLOUDY, PERIOD RAIN FROM SOUTH LATER. GOOD FALLING MODERATE IN RAIN. MODERATE TO ROUGH. From owner-freebsd-standards@FreeBSD.ORG Wed Jun 4 08:46:36 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id B192637B401; Wed, 4 Jun 2003 08:46:36 -0700 (PDT) Date: Wed, 4 Jun 2003 10:46:36 -0500 From: Juli Mallett To: Tony Finch Message-ID: <20030604104636.A88028@FreeBSD.org> References: <20030603144225.GH18938@chiark.greenend.org.uk> <20030603151925.GI18938@chiark.greenend.org.uk> <20030603211357.B70533@espresso.bsdmike.org> <20030604151553.GO18938@chiark.greenend.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030604151553.GO18938@chiark.greenend.org.uk>; from dot@dotat.at on Wed, Jun 04, 2003 at 04:15:53PM +0100 X-Title: Code Maven X-Towel: Yes X-Negacore: Yes X-Authentication-Warning: localhost: juli pwned teh intarweb cc: freebsd-standards@freebsd.org cc: tjr@freebsd.org cc: Mike Barcroft Subject: Re: [PATCH] for review Re: Sed substitution bugs X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 15:46:37 -0000 * Tony Finch [ Date: 2003-06-04 ] [ w.r.t. Re: [PATCH] for review Re: Sed substitution bugs ] > On Tue, Jun 03, 2003 at 09:13:57PM -0400, Mike Barcroft wrote: > > > > Could you add a test case to the regression test in > > src/tools/regression? > > It doesn't pass all the current tests: > > Running test y > --- regress.y.out Fri Jun 28 12:45:00 2002 > +++ - Wed Jun 4 15:12:04 2003 > @@ -1 +1 @@ > -fOO > \ No newline at end of file > +fOO > FAIL: Test y failed: regression detected. See above. (in /FreeBSD/head/tools/regression/usr.bin/sed) > > This isn't a result of my hacking... We seem to bounce back and forth on what exactly counts as passing that test.. Tell ya what, run it against SysV or GNU sed, and patch using the diffs. I need to add a target to regenerate stuff to regress.lib some time, not too hard... Thank you a lot for showing interest in adding regression tests! Thanx, juli. -- juli mallett. email: jmallett@freebsd.org; efnet: juli; From owner-freebsd-standards@FreeBSD.ORG Wed Jun 4 08:55:36 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 73A3637B401; Wed, 4 Jun 2003 08:55:36 -0700 (PDT) Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [193.201.200.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 673F343F3F; Wed, 4 Jun 2003 08:55:35 -0700 (PDT) (envelope-from fanf@chiark.greenend.org.uk) Received: by chiark.greenend.org.uk (Debian Exim 3.35 #1) with local id 19Nabu-0004Uj-00; Wed, 04 Jun 2003 16:55:34 +0100 Date: Wed, 4 Jun 2003 16:55:34 +0100 From: Tony Finch To: Juli Mallett Message-ID: <20030604155534.GQ18938@chiark.greenend.org.uk> References: <20030603144225.GH18938@chiark.greenend.org.uk> <20030603151925.GI18938@chiark.greenend.org.uk> <20030603211357.B70533@espresso.bsdmike.org> <20030604151553.GO18938@chiark.greenend.org.uk> <20030604104636.A88028@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030604104636.A88028@FreeBSD.org> User-Agent: Mutt/1.3.28i Sender: Tony Finch cc: freebsd-standards@freebsd.org cc: tjr@freebsd.org cc: Mike Barcroft Subject: Re: [PATCH] for review Re: Sed substitution bugs X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 15:55:36 -0000 On Wed, Jun 04, 2003 at 10:46:36AM -0500, Juli Mallett wrote: > > We seem to bounce back and forth on what exactly counts as passing > that test.. Tell ya what, run it against SysV or GNU sed, and patch > using the diffs. Solaris: $ echo -n foo | sed y/o/O/ sed: Missing newline at end of file standard input. fOO $ GNU: $ echo -n foo | sed y/o/O/ fOO$ GNU is clearly the right implementation, and it's what the regression test says sed should do. I think sed should be fixed. (I can't do it right now because I'm going climbing.) Tony. -- f.a.n.finch http://dotat.at/ CAPE WRATH TO RATTRAY HEAD INCLUDING ORKNEY: SOUTHEAST 3 OR 4 BETWEEN ORKNEY AND RATTRAY HEAD AT FIRST, OTHERWISE NORTHWEST BACKING SOUTHWEST 3 OR 4, THEN LATER BACKING SOUTH OR SOUTHEAST. RAIN OR SHOWERS. MODERATE WITH FOG PATCHES, BECOMING GOOD. SLIGHT OR MODERATE. From owner-freebsd-standards@FreeBSD.ORG Wed Jun 4 09:08:15 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9129637B401; Wed, 4 Jun 2003 09:08:15 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5B6543F75; Wed, 4 Jun 2003 09:08:13 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h54G86v08066; Wed, 4 Jun 2003 18:08:07 +0200 (MEST) Date: Wed, 4 Jun 2003 18:08:06 +0200 (CEST) From: Harti Brandt To: Tony Finch In-Reply-To: <20030604155534.GQ18938@chiark.greenend.org.uk> Message-ID: <20030604180358.J614@beagle.fokus.fraunhofer.de> References: <20030603144225.GH18938@chiark.greenend.org.uk> <20030603211357.B70533@espresso.bsdmike.org> <20030604104636.A88028@FreeBSD.org> <20030604155534.GQ18938@chiark.greenend.org.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-standards@freebsd.org cc: tjr@freebsd.org Subject: Re: [PATCH] for review Re: Sed substitution bugs X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 16:08:15 -0000 On Wed, 4 Jun 2003, Tony Finch wrote: TF>On Wed, Jun 04, 2003 at 10:46:36AM -0500, Juli Mallett wrote: TF>> TF>> We seem to bounce back and forth on what exactly counts as passing TF>> that test.. Tell ya what, run it against SysV or GNU sed, and patch TF>> using the diffs. TF> TF>Solaris: TF>$ echo -n foo | sed y/o/O/ TF>sed: Missing newline at end of file standard input. TF>fOO TF>$ TF> TF>GNU: TF>$ echo -n foo | sed y/o/O/ TF>fOO$ TF> TF>GNU is clearly the right implementation, and it's what the regression TF>test says sed should do. I think sed should be fixed. (I can't do it TF>right now because I'm going climbing.) Either way is correct since, according to posix, sed works only on text files and a file containing the three characters 'f' 'o' 'o' is not a text file. That said, I think, the GNU variant is the more sane 'unspecified' behaviour. harti -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org From owner-freebsd-standards@FreeBSD.ORG Wed Jun 4 10:38:51 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 084CE37B401; Wed, 4 Jun 2003 10:38:51 -0700 (PDT) Received: from mailbox.univie.ac.at (mailbox.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id C871543F75; Wed, 4 Jun 2003 10:38:49 -0700 (PDT) (envelope-from l.ertl@univie.ac.at) Received: from [10.0.0.2] (adslle.cc.univie.ac.at [131.130.102.11]) by mailbox.univie.ac.at (8.12.2/8.12.2) with ESMTP id h54HcZWe230970; Wed, 4 Jun 2003 19:38:42 +0200 Date: Wed, 4 Jun 2003 19:38:31 +0200 (CEST) From: Lukas Ertl To: freebsd-standards@freebsd.org In-Reply-To: <20030604213152.A59361@dilbert.robbins.dropbear.id.au> Message-ID: <20030604193440.X577@korben.in.tern> References: <20030604213152.A59361@dilbert.robbins.dropbear.id.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-DCC-ZID-Univie-Metrics: mailbox 4244; Body=0 Fuz1=0 Fuz2=0 cc: Lukas Ertl cc: Tim Robbins Subject: Re: [peterw@ifost.org.au: fuser] X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 17:38:51 -0000 Hi -standards people, I've taken an approach to implement the fuser(1) utility. Tim Robbins has sent me a patch from Peter Werner that needed some tweaking to get it running. It works here on a 5.1-CURRENT machine. You can find it at . Please tell me what you think and what needs to be done, and please keep me CC'ed :-) regards, le --=20 Lukas Ertl eMail: l.ertl@univie.ac.at UNIX-Systemadministrator Tel.: (+43 1) 4277-14073 Zentraler Informatikdienst (ZID) Fax.: (+43 1) 4277-9140 der Universit=E4t Wien http://mailbox.univie.ac.at/~le/ From owner-freebsd-standards@FreeBSD.ORG Wed Jun 4 19:47:40 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7123737B401; Wed, 4 Jun 2003 19:47:40 -0700 (PDT) Received: from smtp02.syd.iprimus.net.au (smtp02.syd.iprimus.net.au [210.50.76.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id C8F3B43FAF; Wed, 4 Jun 2003 19:47:39 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au (210.50.40.234) by smtp02.syd.iprimus.net.au (7.0.015) id 3EDD5209000338D4; Thu, 5 Jun 2003 12:47:34 +1000 Received: by dilbert.robbins.dropbear.id.au (Postfix, from userid 1000) id 37E7CC90F; Thu, 5 Jun 2003 12:44:22 +1000 (EST) Date: Thu, 5 Jun 2003 12:44:22 +1000 From: Tim Robbins To: Tony Finch Message-ID: <20030605124421.A82856@dilbert.robbins.dropbear.id.au> References: <20030603144225.GH18938@chiark.greenend.org.uk> <20030603151925.GI18938@chiark.greenend.org.uk> <20030603211357.B70533@espresso.bsdmike.org> <20030604151553.GO18938@chiark.greenend.org.uk> <20030604104636.A88028@FreeBSD.org> <20030604155534.GQ18938@chiark.greenend.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030604155534.GQ18938@chiark.greenend.org.uk>; from dot@dotat.at on Wed, Jun 04, 2003 at 04:55:34PM +0100 cc: Juli Mallett cc: freebsd-standards@FreeBSD.org cc: Mike Barcroft Subject: Re: [PATCH] for review Re: Sed substitution bugs X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2003 02:47:40 -0000 On Wed, Jun 04, 2003 at 04:55:34PM +0100, Tony Finch wrote: > Solaris: > $ echo -n foo | sed y/o/O/ > sed: Missing newline at end of file standard input. > fOO > $ > > GNU: > $ echo -n foo | sed y/o/O/ > fOO$ > > GNU is clearly the right implementation, and it's what the regression > test says sed should do. I think sed should be fixed. (I can't do it > right now because I'm going climbing.) Your input is malformed. Making sed not store the newlines made it easier to fix a whole bunch of bugs, but made it harder to deal with this kind of malformed input in the traditional (for BSD) way. See sed/process.c rev. 1.21 and the PR's it mentions. Warning about missing newlines like Solaris sed does is probably a good idea; I'll see if I can do that. But I don't consider following the traditional BSD behaviour of not adding missing newlines to be a high priority. Tim From owner-freebsd-standards@FreeBSD.ORG Thu Jun 5 11:10:11 2003 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F53A37B401 for ; Thu, 5 Jun 2003 11:10:11 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6471A43F75 for ; Thu, 5 Jun 2003 11:10:10 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h55IAAUp069160 for ; Thu, 5 Jun 2003 11:10:10 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h55IAADg069159; Thu, 5 Jun 2003 11:10:10 -0700 (PDT) Resent-Date: Thu, 5 Jun 2003 11:10:10 -0700 (PDT) Resent-Message-Id: <200306051810.h55IAADg069159@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-standards@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jens Schweikhardt Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E28E37B401 for ; Thu, 5 Jun 2003 11:02:59 -0700 (PDT) Received: from bremen.shuttle.de (bremen.shuttle.de [194.95.249.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2030243F85 for ; Thu, 5 Jun 2003 11:02:58 -0700 (PDT) (envelope-from schweikh@schweikhardt.net) Received: from bremen.shuttle.de (localhost [127.0.0.1]) by bremen.shuttle.de (Postfix) with ESMTP id 1139917D76 for ; Thu, 5 Jun 2003 20:02:56 +0200 (CEST) Received: (from uucp@localhost)h55I2teK005237 for FreeBSD-gnats-submit@freebsd.org; Thu, 5 Jun 2003 20:02:55 +0200 Received: (from schweikh@localhost) by hal9000.schweikhardt.net (8.12.9/8.12.9) id h55I3GIT055188; Thu, 5 Jun 2003 20:03:16 +0200 (CEST) (envelope-from schweikh) Message-Id: <200306051803.h55I3GIT055188@hal9000.schweikhardt.net> Date: Thu, 5 Jun 2003 20:03:16 +0200 (CEST) From: Jens Schweikhardt To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: standards/52972: /bin/sh arithmetic not POSIX compliant X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jens Schweikhardt List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2003 18:10:11 -0000 >Number: 52972 >Category: standards >Synopsis: /bin/sh arithmetic not POSIX compliant >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jun 05 11:10:09 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Jens Schweikhardt >Release: FreeBSD 5.1-BETA i386 >Organization: Digital Details >Environment: System: FreeBSD hal9000.schweikhardt.net 5.1-BETA FreeBSD 5.1-BETA #0: Wed May 21 20:30:29 CEST 2003 toor@hal9000.schweikhardt.net:/usr/obj/share/src/HEAD/sys/HAL9000 i386 Any. >Description: /bin/sh implements only a subset of the operators in $(( ... )) arithmetic. It also does not understand variable names in arithmetic expressions. This missing feature makes it impossible to run the OpenGroup's POSIX validation test suite because the configuration process for the test suite expects a POSIX system shell and makes heavy use of $((var += number)). [I can't just edit the scripts in question to use zsh or ksh93 because the configuration process involves executables calling system(3), make(1) etc which use /bin/sh hardcoded. Replacing /bin/sh is not an option.] >How-To-Repeat: $ /bin/sh $ a=1 $ echo $((a + 1)) # should echo 2 arith: syntax error: "a + 1" $ echo $((a += 1)) # should echo 2 and increment a arith: syntax error: "a += 1" IEEE Std 1003.2-2001 requires the other 'op=' assignment operators as well. The zsh and ksh93 get this right: $ a=1 $ echo $((a + 1)) 2 $ echo $((a += 1)) 2 $ echo $a 2 >Fix: >Release-Note: >Audit-Trail: >Unformatted: