From owner-freebsd-standards@FreeBSD.ORG Mon May 3 11:02:05 2004 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 F212E16A4CF for ; Mon, 3 May 2004 11:02:04 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D46F443D58 for ; Mon, 3 May 2004 11:02:04 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) i43I24tw028590 for ; Mon, 3 May 2004 11:02:04 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i43I24PU028585 for freebsd-standards@freebsd.org; Mon, 3 May 2004 11:02:04 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 3 May 2004 11:02:04 -0700 (PDT) Message-Id: <200405031802.i43I24PU028585@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-standards@FreeBSD.org Subject: Current problem reports assigned to you 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, 03 May 2004 18:02:05 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- s [2001/01/23] misc/24590 standards timezone function not compatible witn Sin o [2001/03/05] bin/25542 standards /bin/sh: null char in quoted string o [2002/02/25] bin/35307 standards standard include files are not standard c o [2003/03/05] bin/48958 standards The type 'bool' has different sizes for C o [2003/04/21] standards/51209standards [PATCH] add a64l()/l64a/l64a_r functions p [2003/06/05] standards/52972standards /bin/sh arithmetic not POSIX compliant o [2003/07/12] standards/54410standards one-true-awk not POSIX compliant (no exte o [2003/09/15] standards/56906standards Several math(3) functions fail to set err o [2003/12/31] standards/60772standards _Bool and bool should be unsigned o [2004/02/05] standards/62388standards sys/resource.h does not pull in dependenc 10 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- f [1995/01/11] i386/105 standards Distributed libm (msun) has non-standard o [2000/09/24] bin/21519 standards sys/dir.h should be deprecated some more o [2000/12/05] kern/23304 standards POSIX clock_gettime, clock_getres return o [2001/01/16] bin/24390 standards Replacing old dir-symlinks when using /bi s [2001/06/18] kern/28260 standards UIO_MAXIOV needs to be made public o [2001/11/20] standards/32126standards getopt(3) not Unix-98 conformant s [2002/03/18] standards/36076standards Implementation of POSIX fuser command o [2002/06/13] standards/39256standards [v]snprintf aren't POSIX-conformant for s o [2002/07/09] misc/40378 standards stdlib.h gives needless warnings with -an p [2002/08/12] standards/41576standards POSIX compliance of ln(1) o [2002/10/23] standards/44425standards getcwd() succeeds even if current dir has o [2002/12/09] standards/46119standards Priority problems for SCHED_OTHER using p o [2002/12/23] standards/46504standards Warnings in headers o [2003/06/22] standards/53613standards FreeBSD doesn't define EPROTO o [2003/06/24] bin/53682 standards [PATCH] add fuser(1) utitity o [2003/07/24] standards/54809standards pcvt deficits o [2003/07/24] standards/54833standards more pcvt deficits o [2003/07/25] standards/54839standards pcvt deficits o [2003/07/31] standards/55112standards glob.h, glob_t's gl_pathc should be "size o [2003/09/04] standards/56476standards cd9660 unicode support simple hack o [2003/09/27] standards/57295standards [patch] make does not include cmd line va o [2003/10/12] standards/57911standards fnmatch ("[[:alpha:]]","x", FNM_PATHNAME) o [2003/10/29] standards/58676standards grantpt(3) alters storage used by ptsname o [2003/11/29] standards/59797standards Implement C99's round[f]() math fucntions p [2003/12/26] standards/60597standards FreeBSD's /usr/include lacks of cpio.h s [2004/02/14] standards/62858standards malloc(0) not C99 compliant p [2004/02/21] standards/63173standards Patch to add getopt_long_only(3) to libc o [2004/03/12] standards/64173standards C99 requires some macros to be c 28 problems total. From owner-freebsd-standards@FreeBSD.ORG Thu May 6 06:39:43 2004 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 1082116A4CE; Thu, 6 May 2004 06:39:42 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC31543D2F; Thu, 6 May 2004 06:39:42 -0700 (PDT) (envelope-from stefanf@FreeBSD.org) Received: from freefall.freebsd.org (stefanf@localhost [127.0.0.1]) i46DdgE6064994; Thu, 6 May 2004 06:39:42 -0700 (PDT) (envelope-from stefanf@freefall.freebsd.org) Received: (from stefanf@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i46DdgRS064990; Thu, 6 May 2004 06:39:42 -0700 (PDT) (envelope-from stefanf) Date: Thu, 6 May 2004 06:39:42 -0700 (PDT) From: Stefan Farfeleder Message-Id: <200405061339.i46DdgRS064990@freefall.freebsd.org> To: stefanf@FreeBSD.org, freebsd-standards@FreeBSD.org, stefanf@FreeBSD.org Subject: Re: standards/64173: C99 requires some macros to be constant expressions 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, 06 May 2004 13:39:43 -0000 Synopsis: C99 requires some macros to be constant expressions Responsible-Changed-From-To: freebsd-standards->stefanf Responsible-Changed-By: stefanf Responsible-Changed-When: Thu May 6 06:38:45 PDT 2004 Responsible-Changed-Why: Over to me. http://www.freebsd.org/cgi/query-pr.cgi?pr=64173 From owner-freebsd-standards@FreeBSD.ORG Fri May 7 10:00:40 2004 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 CF9E816A4CE for ; Fri, 7 May 2004 10:00:40 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0401F43D1F for ; Fri, 7 May 2004 10:00:40 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i47H0dck029429 for ; Fri, 7 May 2004 10:00:39 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i47H0diV029426; Fri, 7 May 2004 10:00:39 -0700 (PDT) (envelope-from gnats) Resent-Date: Fri, 7 May 2004 10:00:39 -0700 (PDT) Resent-Message-Id: <200405071700.i47H0diV029426@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, "Mark D. Baushke" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 195C916A4CE for ; Fri, 7 May 2004 09:56:09 -0700 (PDT) Received: from colo-dns-ext1.juniper.net (colo-dns-ext1.juniper.net [207.17.137.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A89043D53 for ; Fri, 7 May 2004 09:56:08 -0700 (PDT) (envelope-from mdb@juniper.net) Received: from merlot.juniper.net (merlot.juniper.net [172.17.27.10]) i47Gu2l25289; Fri, 7 May 2004 09:56:02 -0700 (PDT) (envelope-from mdb@juniper.net) Received: from juniper.net (garnet.juniper.net [172.17.28.17]) by merlot.juniper.net (8.11.3/8.11.3) with ESMTP id i47GtvJ42909; Fri, 7 May 2004 09:55:57 -0700 (PDT) (envelope-from mdb@juniper.net) Message-Id: <11525.1083948957@juniper.net> Date: Fri, 07 May 2004 09:55:57 -0700 From: "Mark D. Baushke" Sender: mdb@juniper.net To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: Paul Eggert cc: "Simon J. Gerraty" Subject: standards/66357: make POSIX conformance problem ('sh -e' & '+' command-line flag) 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: Fri, 07 May 2004 17:00:40 -0000 >Number: 66357 >Category: standards >Synopsis: make POSIX conformance problem ('sh -e' & '+' command-line) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri May 07 10:00:38 PDT 2004 >Closed-Date: >Last-Modified: >Originator: Mark Baushke >Release: FreeBSD 5.2-RELEASE i386 >Organization: Juniper Networks, Inc. >Environment: System: FreeBSD rat52.juniper.net 5.2-RELEASE FreeBSD 5.2-RELEASE #0: Sun Jan 11 04:21:45 GMT 2004 root@wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC i386 >Description: Background: POSIX 1003.2-1997 states that each makefile command line is processed as if given to system(3) (see URL http://www.opengroup.org/onlinepubs/009695399/utilities/make.html) POSIX 1003.1-2004 (as well as older versions of the standard) states that system() does not use the "sh -e" command to exit immediately if any untested command fails in non-interactive mode. (see URL http://www.opengroup.org/onlinepubs/009695399/functions/system.html) The FreeBSD /usr/bin/make program generates an error and does not support the '+' command line flag properly. (tested on FreeBSD 2.2.8-RELEASE, 3.3-RELEASE, 4.2-RELEASE, 4.10-PRERELEASE and 5.2-RELEASE versions) My guess is that the .POSIX: directive in the test case would not have much impact as the sys.mk file seems to be read before the first Makefile is opened, but I have added that rule to underline that this change is really only required in order to be POSIX compliant. Should you wish to retain your existing behavior, that would be fine as long as the behavior is modified as expected when the .POSIX: directive is given. I have consulted with Simon J. Gerraty who commits changes to the NetBSD version of make as well as providing portable versions of bmake for other platforms (see URL http://www.crufty.net/help/sjg/bmake.html). He says he has committed a patch to the NetBSD -current version of the make program. Part of the e-mail exchange focused on this problem is found here: http://mail-index.netbsd.org/tech-toolchain/2004/05/05/0008.html After my .signature are the log message and URLs for the changes made to the NetBSD. >How-To-Repeat: How to reproduce the problem: The following Makefile --------------- start Makefile --------------- .POSIX: all: x plus sub err x: @echo "Hello,"; false; echo "World" plus: @echo a command +@echo "a command prefixed by '+' executes even with -n" @echo another command subs: @echo make -n @${.MAKE} -f ${MAKEFILE} -n plus @echo make -n -j1 @${.MAKE} -f ${MAKEFILE} -n -j1 plus err: @(echo Now we expect an error...; exit 1) @echo "Oops! you shouldn't see this!" --------------- end Makefile --------------- The make x command should therefore generate two lines: Hello, World with no error on a 'make' command that is POSIX-compliant. The make -n plus command should print echo a command echo "a command prefixed by '+' executes even with -n" a command prefixed by '+' executes even with -n echo another command to show that it is not executing the first and last echo command, but is executing the middle one. The make err command should print Now we expect an error... and exit with an error code 1. Running all of the tests may require adding a few command-line arguments if the paricular version of make does not support setting the .MAKE or MAKEFILE macros such as this: make .MAKE=/usr/bin/make MAKEFILE=Makefile However, as those macros are not required by the POSIX standard, you don't need to worry if they are not being set by default. --------------- begin test results for FreeBSD 5.2-RELEASE --------------- % /usr/bin/make Hello, *** Error code 1 Stop in /tmp/mdb.foo. % /usr/bin/make plus % /usr/bin/make plus a command +@echo "a command prefixed by '+' executes even with -n" +@echo:No such file or directory *** Error code 1 Stop in /tmp/mdb.foo. % /usr/bin/make -n plus echo a command +@echo "a command prefixed by '+' executes even with -n" echo another command % /usr/bin/make -n .MAKE=/usr/bin/make subs echo make -n /usr/bin/make -f Makefile -n plus echo make -n -j1 /usr/bin/make -f Makefile -n -j1 plus % /usr/bin/make .MAKE=/usr/bin/make -n subs echo make -n /usr/bin/make -f Makefile -n plus echo make -n -j1 /usr/bin/make -f Makefile -n -j1 plus % /usr/bin/make err Now we expect an error... *** Error code 1 Stop in /tmp/mdb.foo. % /usr/bin/make -n err (echo Now we expect an error...; exit 1) echo "Oops! you shouldn't see this!" % pwd /tmp/mdb.foo % --------------- end test reults for FreeBSD 5.2-RELEASE --------------- >Fix: Committed to the NetBSD cvs repository on Fri May 7 08:12:15 2004 UTC by sjg Log message: Remove use of sh -e when running in compat mode. Its not posix compliant and serves very little purpose. With this change compat and jobs modes are consistent wrt how they treat each line of a script. Add support for the '+' command line prefix as required by posix. Lines prefixed with '+' are executed even when -n is given. [Actually posix says they should also be done for -q and -t] PR: Reviewed by: jmc http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/compat.c.diff?r1=1.53&r2=1.54 http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/nonints.h.diff?r1=1.31&r2=1.32 http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/job.c.diff?r1=1.84&r2=1.85 http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/unit-tests/Makefile.diff?r1=1.12&r2=1.13 http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/unit-tests/test.exp.diff?r1=1.11&r2=1.12 http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/unit-tests/posix >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-standards@FreeBSD.ORG Sat May 8 06:43:01 2004 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 184F616A4CE; Sat, 8 May 2004 06:43:01 -0700 (PDT) Received: from mail.cs.tu-berlin.de (mail.cs.tu-berlin.de [130.149.17.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32BDE43D1D; Sat, 8 May 2004 06:42:59 -0700 (PDT) (envelope-from novo@cs.tu-berlin.de) Received: from 130-149-145-120.dialup.cs.tu-berlin.de (130-149-145-120.dialup.cs.tu-berlin.de [130.149.145.120]) by mail.cs.tu-berlin.de (8.9.3p2/8.9.3) with ESMTP id PAA28557; Sat, 8 May 2004 15:42:49 +0200 (MEST) Date: Sat, 8 May 2004 15:43:45 +0200 (CEST) From: Harti Brandt X-X-Sender: novo@130-149-145-120.dialup.cs.tu-berlin.de To: "Mark D. Baushke" In-Reply-To: <11525.1083948957@juniper.net> Message-ID: <20040508153845.U641@130-149-145-63.dialup.cs.tu-berlin.de> References: <11525.1083948957@juniper.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-standards@FreeBSD.ORG cc: FreeBSD-gnats-submit@FreeBSD.ORG cc: "Simon J. Gerraty" cc: Paul Eggert Subject: Re: standards/66357: make POSIX conformance problem ('sh -e' & '+' command-line flag) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: harti@FreeBSD.ORG List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2004 13:43:01 -0000 On Fri, 7 May 2004, Mark D. Baushke wrote: > > >Number: 66357 > >Category: standards > >Synopsis: make POSIX conformance problem ('sh -e' & '+' command-line) > >Confidential: no > >Severity: non-critical > >Priority: low > >Responsible: freebsd-standards > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: sw-bug > >Submitter-Id: current-users > >Arrival-Date: Fri May 07 10:00:38 PDT 2004 > >Closed-Date: > >Last-Modified: > >Originator: Mark Baushke > >Release: FreeBSD 5.2-RELEASE i386 > >Organization: > Juniper Networks, Inc. > >Environment: > System: FreeBSD rat52.juniper.net 5.2-RELEASE FreeBSD 5.2-RELEASE #0: Sun Jan 11 04:21:45 GMT 2004 root@wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC i386 > > >Description: > Background: > > POSIX 1003.2-1997 states that each makefile command line is processed > as if given to system(3) (see URL > http://www.opengroup.org/onlinepubs/009695399/utilities/make.html) > > POSIX 1003.1-2004 (as well as older versions of the standard) states > that system() does not use the "sh -e" command to exit immediately if > any untested command fails in non-interactive mode. (see URL > http://www.opengroup.org/onlinepubs/009695399/functions/system.html) > > The FreeBSD /usr/bin/make program generates an error and does not > support the '+' command line flag properly. > (tested on FreeBSD 2.2.8-RELEASE, 3.3-RELEASE, 4.2-RELEASE, > 4.10-PRERELEASE and 5.2-RELEASE versions) > > My guess is that the .POSIX: directive in the test case would not have > much impact as the sys.mk file seems to be read before the first > Makefile is opened, but I have added that rule to underline that this > change is really only required in order to be POSIX compliant. > > Should you wish to retain your existing behavior, that would be fine as > long as the behavior is modified as expected when the .POSIX: directive > is given. > > I have consulted with Simon J. Gerraty who commits changes to the NetBSD > version of make as well as providing portable versions of bmake for > other platforms (see URL http://www.crufty.net/help/sjg/bmake.html). He > says he has committed a patch to the NetBSD -current version of the make > program. > > Part of the e-mail exchange focused on this problem is found here: > > http://mail-index.netbsd.org/tech-toolchain/2004/05/05/0008.html > > After my .signature are the log message and URLs for the changes made to > the NetBSD. > > >How-To-Repeat: > How to reproduce the problem: > > The following Makefile > > --------------- start Makefile --------------- > .POSIX: > all: x plus sub err > x: > @echo "Hello,"; false; echo "World" > plus: > @echo a command > +@echo "a command prefixed by '+' executes even with -n" > @echo another command > subs: > @echo make -n > @${.MAKE} -f ${MAKEFILE} -n plus > @echo make -n -j1 > @${.MAKE} -f ${MAKEFILE} -n -j1 plus > > err: > @(echo Now we expect an error...; exit 1) > @echo "Oops! you shouldn't see this!" > > --------------- end Makefile --------------- > > The > make x > > command should therefore generate two lines: > > Hello, > World > > with no error on a 'make' command that is POSIX-compliant. > > The > make -n plus > > command should print > > echo a command > echo "a command prefixed by '+' executes even with -n" > a command prefixed by '+' executes even with -n > echo another command > > to show that it is not executing the first and last echo command, but > is executing the middle one. > > The > make err > > command should print > > Now we expect an error... > > and exit with an error code 1. > > Running all of the tests may require adding a few command-line > arguments if the paricular version of make does not support setting > the .MAKE or MAKEFILE macros such as this: > > make .MAKE=/usr/bin/make MAKEFILE=Makefile > > However, as those macros are not required by the POSIX standard, you > don't need to worry if they are not being set by default. > > --------------- begin test results for FreeBSD 5.2-RELEASE --------------- > % /usr/bin/make > Hello, > *** Error code 1 > > Stop in /tmp/mdb.foo. > % /usr/bin/make plus > % /usr/bin/make plus > a command > +@echo "a command prefixed by '+' executes even with -n" > +@echo:No such file or directory > *** Error code 1 > > Stop in /tmp/mdb.foo. > % /usr/bin/make -n plus > echo a command > +@echo "a command prefixed by '+' executes even with -n" > echo another command > % /usr/bin/make -n .MAKE=/usr/bin/make subs > echo make -n > /usr/bin/make -f Makefile -n plus > echo make -n -j1 > /usr/bin/make -f Makefile -n -j1 plus > % /usr/bin/make .MAKE=/usr/bin/make -n subs > echo make -n > /usr/bin/make -f Makefile -n plus > echo make -n -j1 > /usr/bin/make -f Makefile -n -j1 plus > % /usr/bin/make err > Now we expect an error... > *** Error code 1 > > Stop in /tmp/mdb.foo. > % /usr/bin/make -n err > (echo Now we expect an error...; exit 1) > echo "Oops! you shouldn't see this!" > % pwd > /tmp/mdb.foo > % > --------------- end test reults for FreeBSD 5.2-RELEASE --------------- > > >Fix: > Committed to the NetBSD cvs repository on Fri May 7 08:12:15 2004 UTC by sjg > > Log message: > > Remove use of sh -e when running in compat mode. > Its not posix compliant and serves very little purpose. > With this change compat and jobs modes are consistent wrt how > they treat each line of a script. > > Add support for the '+' command line prefix as required by posix. > Lines prefixed with '+' are executed even when -n is given. > [Actually posix says they should also be done for -q and -t] > > PR: > Reviewed by: jmc > > http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/compat.c.diff?r1=1.53&r2=1.54 > > http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/nonints.h.diff?r1=1.31&r2=1.32 > http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/job.c.diff?r1=1.84&r2=1.85 > http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/unit-tests/Makefile.diff?r1=1.12&r2=1.13 > http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/unit-tests/test.exp.diff?r1=1.11&r2=1.12 > http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/unit-tests/posix > >Release-Note: > >Audit-Trail: > >Unformatted: > _______________________________________________ > freebsd-standards@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-standards > To unsubscribe, send any mail to "freebsd-standards-unsubscribe@freebsd.org" > > The 'sh -e' servers a purpose if you have a more complicated shell line say a loop. Without -e make will not stop even if there is an error in an inner command of a shell loop, while with -e it will exit. I'd say that not using -e is a posix-bug, not a feature and, in fact, there has been thoughts on the austin group mailing list to review this. I'd think even if we remove the -e in the posix case, we must retain it in the non-posix case. harti From owner-freebsd-standards@FreeBSD.ORG Sat May 8 06:50:31 2004 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 3DB7816A4CE for ; Sat, 8 May 2004 06:50:31 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 085C543D4C for ; Sat, 8 May 2004 06:50:30 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i48DoTVV059748 for ; Sat, 8 May 2004 06:50:29 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i48DoTJI059747; Sat, 8 May 2004 06:50:29 -0700 (PDT) (envelope-from gnats) Date: Sat, 8 May 2004 06:50:29 -0700 (PDT) Message-Id: <200405081350.i48DoTJI059747@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Harti Brandt Subject: Re: standards/66357: make POSIX conformance problem ('sh -e' & '+' command-line flag) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Harti Brandt List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2004 13:50:31 -0000 The following reply was made to PR standards/66357; it has been noted by GNATS. From: Harti Brandt To: "Mark D. Baushke" Cc: FreeBSD-gnats-submit@FreeBSD.ORG, Paul Eggert , "Simon J. Gerraty" , freebsd-standards@FreeBSD.ORG Subject: Re: standards/66357: make POSIX conformance problem ('sh -e' & '+' command-line flag) Date: Sat, 8 May 2004 15:43:45 +0200 (CEST) On Fri, 7 May 2004, Mark D. Baushke wrote: > > >Number: 66357 > >Category: standards > >Synopsis: make POSIX conformance problem ('sh -e' & '+' command-line) > >Confidential: no > >Severity: non-critical > >Priority: low > >Responsible: freebsd-standards > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: sw-bug > >Submitter-Id: current-users > >Arrival-Date: Fri May 07 10:00:38 PDT 2004 > >Closed-Date: > >Last-Modified: > >Originator: Mark Baushke > >Release: FreeBSD 5.2-RELEASE i386 > >Organization: > Juniper Networks, Inc. > >Environment: > System: FreeBSD rat52.juniper.net 5.2-RELEASE FreeBSD 5.2-RELEASE #0: Sun Jan 11 04:21:45 GMT 2004 root@wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC i386 > > >Description: > Background: > > POSIX 1003.2-1997 states that each makefile command line is processed > as if given to system(3) (see URL > http://www.opengroup.org/onlinepubs/009695399/utilities/make.html) > > POSIX 1003.1-2004 (as well as older versions of the standard) states > that system() does not use the "sh -e" command to exit immediately if > any untested command fails in non-interactive mode. (see URL > http://www.opengroup.org/onlinepubs/009695399/functions/system.html) > > The FreeBSD /usr/bin/make program generates an error and does not > support the '+' command line flag properly. > (tested on FreeBSD 2.2.8-RELEASE, 3.3-RELEASE, 4.2-RELEASE, > 4.10-PRERELEASE and 5.2-RELEASE versions) > > My guess is that the .POSIX: directive in the test case would not have > much impact as the sys.mk file seems to be read before the first > Makefile is opened, but I have added that rule to underline that this > change is really only required in order to be POSIX compliant. > > Should you wish to retain your existing behavior, that would be fine as > long as the behavior is modified as expected when the .POSIX: directive > is given. > > I have consulted with Simon J. Gerraty who commits changes to the NetBSD > version of make as well as providing portable versions of bmake for > other platforms (see URL http://www.crufty.net/help/sjg/bmake.html). He > says he has committed a patch to the NetBSD -current version of the make > program. > > Part of the e-mail exchange focused on this problem is found here: > > http://mail-index.netbsd.org/tech-toolchain/2004/05/05/0008.html > > After my .signature are the log message and URLs for the changes made to > the NetBSD. > > >How-To-Repeat: > How to reproduce the problem: > > The following Makefile > > --------------- start Makefile --------------- > .POSIX: > all: x plus sub err > x: > @echo "Hello,"; false; echo "World" > plus: > @echo a command > +@echo "a command prefixed by '+' executes even with -n" > @echo another command > subs: > @echo make -n > @${.MAKE} -f ${MAKEFILE} -n plus > @echo make -n -j1 > @${.MAKE} -f ${MAKEFILE} -n -j1 plus > > err: > @(echo Now we expect an error...; exit 1) > @echo "Oops! you shouldn't see this!" > > --------------- end Makefile --------------- > > The > make x > > command should therefore generate two lines: > > Hello, > World > > with no error on a 'make' command that is POSIX-compliant. > > The > make -n plus > > command should print > > echo a command > echo "a command prefixed by '+' executes even with -n" > a command prefixed by '+' executes even with -n > echo another command > > to show that it is not executing the first and last echo command, but > is executing the middle one. > > The > make err > > command should print > > Now we expect an error... > > and exit with an error code 1. > > Running all of the tests may require adding a few command-line > arguments if the paricular version of make does not support setting > the .MAKE or MAKEFILE macros such as this: > > make .MAKE=/usr/bin/make MAKEFILE=Makefile > > However, as those macros are not required by the POSIX standard, you > don't need to worry if they are not being set by default. > > --------------- begin test results for FreeBSD 5.2-RELEASE --------------- > % /usr/bin/make > Hello, > *** Error code 1 > > Stop in /tmp/mdb.foo. > % /usr/bin/make plus > % /usr/bin/make plus > a command > +@echo "a command prefixed by '+' executes even with -n" > +@echo:No such file or directory > *** Error code 1 > > Stop in /tmp/mdb.foo. > % /usr/bin/make -n plus > echo a command > +@echo "a command prefixed by '+' executes even with -n" > echo another command > % /usr/bin/make -n .MAKE=/usr/bin/make subs > echo make -n > /usr/bin/make -f Makefile -n plus > echo make -n -j1 > /usr/bin/make -f Makefile -n -j1 plus > % /usr/bin/make .MAKE=/usr/bin/make -n subs > echo make -n > /usr/bin/make -f Makefile -n plus > echo make -n -j1 > /usr/bin/make -f Makefile -n -j1 plus > % /usr/bin/make err > Now we expect an error... > *** Error code 1 > > Stop in /tmp/mdb.foo. > % /usr/bin/make -n err > (echo Now we expect an error...; exit 1) > echo "Oops! you shouldn't see this!" > % pwd > /tmp/mdb.foo > % > --------------- end test reults for FreeBSD 5.2-RELEASE --------------- > > >Fix: > Committed to the NetBSD cvs repository on Fri May 7 08:12:15 2004 UTC by sjg > > Log message: > > Remove use of sh -e when running in compat mode. > Its not posix compliant and serves very little purpose. > With this change compat and jobs modes are consistent wrt how > they treat each line of a script. > > Add support for the '+' command line prefix as required by posix. > Lines prefixed with '+' are executed even when -n is given. > [Actually posix says they should also be done for -q and -t] > > PR: > Reviewed by: jmc > > http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/compat.c.diff?r1=1.53&r2=1.54 > > http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/nonints.h.diff?r1=1.31&r2=1.32 > http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/job.c.diff?r1=1.84&r2=1.85 > http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/unit-tests/Makefile.diff?r1=1.12&r2=1.13 > http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/unit-tests/test.exp.diff?r1=1.11&r2=1.12 > http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/unit-tests/posix > >Release-Note: > >Audit-Trail: > >Unformatted: > _______________________________________________ > freebsd-standards@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-standards > To unsubscribe, send any mail to "freebsd-standards-unsubscribe@freebsd.org" > > The 'sh -e' servers a purpose if you have a more complicated shell line say a loop. Without -e make will not stop even if there is an error in an inner command of a shell loop, while with -e it will exit. I'd say that not using -e is a posix-bug, not a feature and, in fact, there has been thoughts on the austin group mailing list to review this. I'd think even if we remove the -e in the posix case, we must retain it in the non-posix case. harti From owner-freebsd-standards@FreeBSD.ORG Sat May 8 12:48:04 2004 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 871AD16A4CE for ; Sat, 8 May 2004 12:48:04 -0700 (PDT) Received: from bgezal.rise.tuwien.ac.at (bgezal.rise.tuwien.ac.at [128.130.59.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA86343D62 for ; Sat, 8 May 2004 12:48:02 -0700 (PDT) (envelope-from stefan@fafoe.narf.at) Received: from fafoe.narf.at (unknown [212.186.3.235]) by bgezal.rise.tuwien.ac.at (Postfix) with ESMTP id 2F53D20B3 for ; Sat, 8 May 2004 21:48:01 +0200 (CEST) Received: from wombat.fafoe.narf.at (wombat.fafoe.narf.at [192.168.1.42]) by fafoe.narf.at (Postfix) with ESMTP id E9CDE410C for ; Sat, 8 May 2004 21:47:53 +0200 (CEST) Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id C82C4388; Sat, 8 May 2004 21:47:51 +0200 (CEST) Date: Sat, 8 May 2004 21:47:51 +0200 From: Stefan Farfeleder To: freebsd-standards@FreeBSD.org Message-ID: <20040508194748.GN29712@wombat.fafoe.narf.at> Mail-Followup-To: freebsd-standards@FreeBSD.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="y96v7rNg6HAoELs5" Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: Fixing ilogb() 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: Sat, 08 May 2004 19:48:04 -0000 --y96v7rNg6HAoELs5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I found two problems with our current ilogb() implemenation(s). - Both the man page and FP_ILOGB0 claim that ilogb(0) returns INT_MIN while the implementation in s_ilogb.c returns -INT_MAX. We really have to decide on one value (both are conforming to C99, I've attached the text). The attached patch assumes that -INT_MAX is kept. On a related note, is there a reason why doesn't use 's __INT_M{AX,IN} for the FP_ILOGB* macros? - On i386 the assembler file s_ilogb.S is used instead. It uses the instruction fxtract which returns INT_MIN for 0, infinity and NaN. Except for infinity this conforms too, but doesn't play well with our MI definitions for FP_ILOGB*. In the attached patch I've aligned s_ilogb.S's behaviour with s_ilogb.c, the alternative would be just fixing infinity and making FP_ILOGB* MD. Opinions? Cheers, Stefan --y96v7rNg6HAoELs5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="c99-ilogb.txt" 7.12 Mathematics 8 The macros FP_ILOGB0 FP_ILOGBNAN expand to integer constant expressions whose values are returned by ilogb(x) if x is zero or NaN, respectively. The value of FP_ILOGB0 shall be either INT_MIN or -INT_MAX. The value of FP_ILOGBNAN shall be either INT_MAX or INT_MIN. 7.12.6.5 The ilogb functions Synopsis 1 #include int ilogb(double x); int ilogbf(float x); int ilogbl(long double x); Description 2 The ilogb functions extract the exponent of x as a signed int value. If x is zero they compute the value FP_ILOGB0; if x is infinite they compute the value INT_MAX; if x is a NaN they compute the value FP_ILOGBNAN; otherwise, they are equivalent to calling the corresponding logb function and casting the returned value to type int. A range error may occur if x is 0. --y96v7rNg6HAoELs5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ilogb.diff" Index: src/lib/msun/i387/s_ilogb.S =================================================================== RCS file: /usr/home/ncvs/src/lib/msun/i387/s_ilogb.S,v retrieving revision 1.8 diff -u -r1.8 s_ilogb.S --- src/lib/msun/i387/s_ilogb.S 6 Jun 2000 12:12:36 -0000 1.8 +++ src/lib/msun/i387/s_ilogb.S 8 May 2004 18:57:27 -0000 @@ -43,11 +43,27 @@ subl $4,%esp fldl 8(%ebp) + fxam + fnstsw %ax + sahf + jc .L2 + jnp .L3 + fxtract fstp %st fistpl -4(%ebp) movl -4(%ebp),%eax - +.L1: leave ret + +.L2: + /* Depending on ilogb(NAN) == ilogb(INFINITY) */ + movl $0x7fffffff,%eax /* FP_ILOGBNAN, INT_MAX */ + fstp %st + jmp .L1 +.L3: + movl $0x80000001,%eax /* FP_ILOGB0 */ + fstp %st + jmp .L1 Index: src/lib/msun/man/ieee.3 =================================================================== RCS file: /usr/home/ncvs/src/lib/msun/man/ieee.3,v retrieving revision 1.13 diff -u -r1.13 ieee.3 --- src/lib/msun/man/ieee.3 7 May 2004 18:56:31 -0000 1.13 +++ src/lib/msun/man/ieee.3 8 May 2004 18:48:29 -0000 @@ -116,11 +116,14 @@ in integer format. .Fn ilogb \*(Pm\*(If returns -.Dv INT_MAX +.Dv INT_MAX , +.Fn ilogb \*(Pm\*(Na +returns +.Dv FP_ILOGBNAN and .Fn ilogb 0 returns -.Dv INT_MIN . +.Dv FP_ILOGB0 . .Pp .Fn nextafter and Index: src/lib/msun/src/math.h =================================================================== RCS file: /usr/home/ncvs/src/lib/msun/src/math.h,v retrieving revision 1.32 diff -u -r1.32 math.h --- src/lib/msun/src/math.h 7 May 2004 18:56:31 -0000 1.32 +++ src/lib/msun/src/math.h 8 May 2004 18:45:25 -0000 @@ -35,7 +35,7 @@ #define HUGE_VAL (__infinity.__ud) #if __ISO_C_VISIBLE >= 1999 -#define FP_ILOGB0 (-0x7fffffff - 1) /* INT_MIN */ +#define FP_ILOGB0 (-0x7fffffff) /* -INT_MAX */ #define FP_ILOGBNAN 0x7fffffff /* INT_MAX */ #define HUGE_VALF (float)HUGE_VAL #define HUGE_VALL (long double)HUGE_VAL --y96v7rNg6HAoELs5-- From owner-freebsd-standards@FreeBSD.ORG Sat May 8 15:58:49 2004 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 DD02B16A4CE for ; Sat, 8 May 2004 15:58:49 -0700 (PDT) Received: from VARK.homeunix.com (adsl-68-124-137-57.dsl.pltn13.pacbell.net [68.124.137.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5151443D4C for ; Sat, 8 May 2004 15:58:49 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.10/8.12.10) with ESMTP id i48MwcAd016023 for ; Sat, 8 May 2004 15:58:38 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.10/8.12.10/Submit) id i48Mwcj6016022 for freebsd-standards@FreeBSD.org; Sat, 8 May 2004 15:58:38 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Sat, 8 May 2004 15:58:38 -0700 From: David Schultz To: freebsd-standards@FreeBSD.ORG Message-ID: <20040508225838.GA15663@VARK.homeunix.com> Mail-Followup-To: freebsd-standards@FreeBSD.org References: <20040508194748.GN29712@wombat.fafoe.narf.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040508194748.GN29712@wombat.fafoe.narf.at> Subject: Re: Fixing ilogb() 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: Sat, 08 May 2004 22:58:50 -0000 On Sat, May 08, 2004, Stefan Farfeleder wrote: > I found two problems with our current ilogb() implemenation(s). > > - Both the man page and FP_ILOGB0 claim that ilogb(0) returns INT_MIN > while the implementation in s_ilogb.c returns -INT_MAX. We really > have to decide on one value (both are conforming to C99, I've attached > the text). The attached patch assumes that -INT_MAX is kept. FWIW, SunOS has historically used the following mapping: ilogb(0) ==> -INT_MAX ilogb(NAN) ==> INT_MAX ilogb(INFINITY) ==> INT_MAX This matches OS X, our MI ilogb() implementation[1], and your patch, and I think those are pretty good reasons to use your version. > On a related note, is there a reason why doesn't use > 's __INT_M{AX,IN} for the FP_ILOGB* macros? Yes, machine/_limits.h did not exist when it was written, so there was no way to get INT_{MIN,MAX} without namespace pollution. It would be a good idea to use these in math.h and s_ilogb[f].c now. > - On i386 the assembler file s_ilogb.S is used instead. It uses the > instruction fxtract which returns INT_MIN for 0, infinity and NaN. > Except for infinity this conforms too, but doesn't play well with our > MI definitions for FP_ILOGB*. In the attached patch I've aligned > s_ilogb.S's behaviour with s_ilogb.c, the alternative would be just > fixing infinity and making FP_ILOGB* MD. Although it would be legitimate to make FP_ILOGB* MD, we have to fix the infinity case anyway, so we might as well make the NAN and 0 cases MI. FWIW, I was working on some faster MD implementations of fpclassify() and friends a while ago, and getting these corner cases to be consistent is a big PITA. ;-) [1] This is unsurprising, given its origin.