From owner-freebsd-standards@FreeBSD.ORG Sun Jan 4 05:40:17 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 1BF0D16A4CE for ; Sun, 4 Jan 2004 05:40:17 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 196E143D4C for ; Sun, 4 Jan 2004 05:40:16 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i04DeFFR031543 for ; Sun, 4 Jan 2004 05:40:15 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i04DeFaw031541; Sun, 4 Jan 2004 05:40:15 -0800 (PST) (envelope-from gnats) Date: Sun, 4 Jan 2004 05:40:15 -0800 (PST) Message-Id: <200401041340.i04DeFaw031541@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Bruce Evans Subject: Re: standards/60772: _Bool and bool should be unsigned X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bruce Evans List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jan 2004 13:40:17 -0000 The following reply was made to PR standards/60772; it has been noted by GNATS. From: Bruce Evans To: Jonathan Lennox Cc: freebsd-gnats-submit@freebsd.org Subject: Re: standards/60772: _Bool and bool should be unsigned Date: Mon, 5 Jan 2004 00:39:01 +1100 (EST) On Fri, 2 Jan 2004, Jonathan Lennox wrote: > Notice also PR bin/48958 -- in RELENG_4, the 'bool' type isn't > binary-compatible between C and C++. Another reason to drop it from > RELENG_4. Hmm. The absence of stdbool.h in glibc-2.2.5 is mostly likely just because is part of gcc (glibc doesn't have stddef.h either). We have gcc's stdbool.h in RELENG_4 but don't install it. It uses: % typedef enum % { % false = 0, % true = 1 % } bool; This causes slightly different problems than typedef "int bool". I noticed the following: - non-problem: the enum is apparently implemented as an unsigned int, so assignments of "true" to a bitfield of width 1 work right. - bitfields can't have type enum for C compilers (according to TenDRA), so the above is very unportable. - bool can hold values other than true and false. So can bool bitfields of width larger than 1. - same binary compability problem as "int bool". Enums apparently always have the same size and alignment as int in gcc, presumably because enums are too much like ints to be very useful. I think we can't just unsupport it, since gcc has it. Approx. 20 ports reference stdbool.h in their patches. Bruce From owner-freebsd-standards@FreeBSD.ORG Sun Jan 4 14:30:22 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 457F916A4CE for ; Sun, 4 Jan 2004 14:30:22 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2980043D45 for ; Sun, 4 Jan 2004 14:30:20 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i04MUJFR039340 for ; Sun, 4 Jan 2004 14:30:19 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i04MUJm2039334; Sun, 4 Jan 2004 14:30:19 -0800 (PST) (envelope-from gnats) Date: Sun, 4 Jan 2004 14:30:19 -0800 (PST) Message-Id: <200401042230.i04MUJm2039334@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Tony Finch Subject: Re: standards/60772: _Bool and bool should be unsigned X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Tony Finch List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jan 2004 22:30:22 -0000 The following reply was made to PR standards/60772; it has been noted by GNATS. From: Tony Finch To: Bruce Evans Cc: bug-followup@FreeBSD.org Subject: Re: standards/60772: _Bool and bool should be unsigned Date: Sun, 4 Jan 2004 22:23:46 +0000 On Sun, Jan 04, 2004 at 05:40:15AM -0800, Bruce Evans wrote: > > We have gcc's stdbool.h in RELENG_4 but don't install it. It uses: > > % typedef enum > % { > % false = 0, > % true = 1 > % } bool; > > This causes slightly different problems than typedef "int bool". I > noticed the following: Also, the standard requires that bool, true, and false are #defines. Tony. -- f.a.n.finch http://dotat.at/ MULL OF KINTYRE TO ARDNAMURCHAN POINT: SOUTH VEERING SOUTHWEST AT 4 OR 5 LOCALLY 6, DECREASING 3 OR 4 FOR A TIME. RAIN FOR MUCH OF THE TIME. MODERATE DECREASING POOR AT TIMES. MODERATE TO ROUGH. From owner-freebsd-standards@FreeBSD.ORG Mon Jan 5 11:03:52 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 9930A16A4CE for ; Mon, 5 Jan 2004 11:03:52 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 518AC43D70 for ; Mon, 5 Jan 2004 11:01:42 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) i05J1gFR016148 for ; Mon, 5 Jan 2004 11:01:42 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i05J1gNS016142 for freebsd-standards@freebsd.org; Mon, 5 Jan 2004 11:01:42 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 5 Jan 2004 11:01:42 -0800 (PST) Message-Id: <200401051901.i05J1gNS016142@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, 05 Jan 2004 19:03:52 -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 [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/06/20] standards/53554standards interval timers not cleared in fork() 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 9 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2001/01/16] bin/24390 standards Replacing old dir-symlinks when using /bi 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/04/22] standards/51292standards [PATCH] add ecvt()/fcvt()/gcvt() function 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 22 problems total. From owner-freebsd-standards@FreeBSD.ORG Mon Jan 5 11:05:37 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 159B216A4CE for ; Mon, 5 Jan 2004 11:05:37 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0A2B43D80 for ; Mon, 5 Jan 2004 11:04:38 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.10/8.12.10) with ESMTP id i05J3SFR018318 for ; Mon, 5 Jan 2004 11:03:28 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i05J3Rv6018312 for standards@freebsd.org; Mon, 5 Jan 2004 11:03:27 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 5 Jan 2004 11:03:27 -0800 (PST) Message-Id: <200401051903.i05J3Rv6018312@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: 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, 05 Jan 2004 19:05:37 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2001/08/18] kern/29844 standards [PATCH] setpgrp does not behave as manual 1 problem total. Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2001/03/05] bin/25542 standards /bin/sh: null char in quoted string 1 problem 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 s [2001/06/18] kern/28260 standards UIO_MAXIOV needs to be made public 4 problems total. From owner-freebsd-standards@FreeBSD.ORG Wed Jan 7 20:10:20 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 533BD16A4CE for ; Wed, 7 Jan 2004 20:10:20 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8742343D39 for ; Wed, 7 Jan 2004 20:10:19 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i084AJFR097133 for ; Wed, 7 Jan 2004 20:10:19 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i084AJDS097132; Wed, 7 Jan 2004 20:10:19 -0800 (PST) (envelope-from gnats) Date: Wed, 7 Jan 2004 20:10:19 -0800 (PST) Message-Id: <200401080410.i084AJDS097132@freefall.freebsd.org> To: standards@FreeBSD.org From: Ryan Sommers Subject: Re: i386/105: Distributed libm (msun) has non-standard error handling. X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Ryan Sommers List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2004 04:10:20 -0000 The following reply was made to PR i386/105; it has been noted by GNATS. From: Ryan Sommers To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: i386/105: Distributed libm (msun) has non-standard error handling. Date: Wed, 07 Jan 2004 22:05:27 -0600 It looks like this problem has since been resolved. I believe this PR can be closed. ryans@lilshadow(~/src):cat test.c #include #include main () { printf ("acos = %g\n", acos (-2.0)); printf ("pow = %g\n", pow(3, 1000001)); } ryans@lilshadow(~/src):gcc -lm -o test test.c ryans@lilshadow(~/src):./test acos = nan pow = inf ryans@lilshadow(~/src): -- Ryan Sommers ryans@gamersimpact.com From owner-freebsd-standards@FreeBSD.ORG Thu Jan 8 01:30:19 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 1CE7916A4CE for ; Thu, 8 Jan 2004 01:30:19 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE07E43D31 for ; Thu, 8 Jan 2004 01:30:17 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i089UHFR024800 for ; Thu, 8 Jan 2004 01:30:17 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i089UHZL024798; Thu, 8 Jan 2004 01:30:17 -0800 (PST) (envelope-from gnats) Date: Thu, 8 Jan 2004 01:30:17 -0800 (PST) Message-Id: <200401080930.i089UHZL024798@freefall.freebsd.org> To: standards@FreeBSD.org From: Bruce Evans Subject: Re: i386/105: Distributed libm (msun) has non-standard error handling. X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bruce Evans List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2004 09:30:19 -0000 The following reply was made to PR i386/105; it has been noted by GNATS. From: Bruce Evans To: Ryan Sommers Cc: freebsd-gnats-submit@freebsd.org Subject: Re: i386/105: Distributed libm (msun) has non-standard error handling. Date: Thu, 8 Jan 2004 20:28:06 +1100 (EST) On Wed, 7 Jan 2004, Ryan Sommers wrote: > It looks like this problem has since been resolved. I believe this PR > can be closed. > > ryans@lilshadow(~/src):cat test.c > #include > #include > > main () > { > printf ("acos = %g\n", acos (-2.0)); > printf ("pow = %g\n", pow(3, 1000001)); > } > ryans@lilshadow(~/src):gcc -lm -o test test.c > ryans@lilshadow(~/src):./test > acos = nan > pow = inf Many aspects of this are still open: - adding "assert(errno == EDOM);" would show that error handling does not conform to C90 (or the man page for at least the VAX and Tahoe cases; the handing of domain errors for other cases seems to be undocumented in the man pages). - adding "#include ... fpsetmask(fpgetmask() | FP_X_INV)" would show that the oringal problem still exists, unless fpsetmask() is permitted to break the operation of standard functions. Using fpsetmask() gives undefined behaviour by taking the program out of C90 abd by fpsetmask()'s docmentation not being detailed enough to define the behaviour. C99 defines the effect of the feset*() family on library functions in detail. I don't completely understand this, and C99 avoids the problem by not providing a way to unmask traps for FP exceptions. This is mainly a documentation problem. Math functions should eventually do the the following: - not support C90 (they never did) - conform to C99 with the math extensions. Take the option to never set errno for math functions. - have a nonstandard fesetmask() function whose use breaks C99 conformance in documented ways (should it affect math functions or only application code?). - conform to POSIX.1-2001. Set math_errhandling to MATH_ERREXCEPT to indicate that setting errno is not done. - document the above, and don't document VAX and Tahoe error handling. - document "raise"ing of FP exceptions more clearly than POSIX (does it call raise() or raise a SIGFPE? It had better not by default, but fpsetmask() can certainly cause it to). See also PR 56906. Bruce From owner-freebsd-standards@FreeBSD.ORG Thu Jan 8 13:11:21 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 1A7E616A4E6 for ; Thu, 8 Jan 2004 13:11:21 -0800 (PST) Received: from mail.soaustin.net (mail.soaustin.net [207.200.4.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADCC843D2D for ; Thu, 8 Jan 2004 13:11:19 -0800 (PST) (envelope-from linimon@lonesome.com) Received: from lonesome.lonesome.com (cs242719-195.austin.rr.com [24.27.19.195]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mail.soaustin.net (Postfix) with ESMTP id DB78B146F8; Thu, 8 Jan 2004 15:11:16 -0600 (CST) From: Mark Linimon Organization: Lonesome Dove Computing Services Date: Thu, 8 Jan 2004 15:10:39 -0600 User-Agent: KMail/1.5.4 To: freebsd-standards@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401081510.39015.linimon@lonesome.com> cc: postmaster@netfang.net Subject: Fwd: Re: ports/52016: New port: lang/harbour - A Clipper-compatible compiler 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, 08 Jan 2004 21:11:21 -0000 Hello. I'm a ports committer trying to help a submitter get a port ready for inclusion in the tree. This problem is clearly outside my league, so any suggestions on how I can help him would be appreciated. mcl ---------- Forwarded Message ---------- [mcl's cited compile error:] > ../../../../source/rtl/bsd/gcc/librtl.a(filesys.o): In function > `hb_fsCommit': > /usr/ports/lang/harbour/work/harbour/source/rtl/bsd/gcc/../../filesys.c:14 >92: undefined reference to `fdatasync' [the submitter replied:] The hb_fsCommit function in filesys.c only attempts to use fdatasync if _POSIX_SYNCHRONIZED_IO is defined, so this error appears to be due to a bug in the POSIX library implementation in GCC on -current. The fdatasync function is a POSIX function that appears to me to be mandated to be present, even if unimplemented, if _POSIX_SYNCHRONIZED_IO is defined in unistd.h. I'm not sure if I should add a FreeBSD-specific workaround for the second error based on certain (currently unknown to me) values of __GNUC__ or what... ------------------------------------------------------- From owner-freebsd-standards@FreeBSD.ORG Thu Jan 8 13:34:02 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 44D5816A4CE; Thu, 8 Jan 2004 13:34:02 -0800 (PST) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4155243D2F; Thu, 8 Jan 2004 13:33:50 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com ([66.31.45.197]) by comcast.net (rwcrmhc11) with ESMTP id <20040108213349013008hacje>; Thu, 8 Jan 2004 21:33:49 +0000 Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])i08LXp7d041872; Thu, 8 Jan 2004 16:33:51 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)i08LXoH0041871; Thu, 8 Jan 2004 16:33:50 -0500 (EST) (envelope-from rodrigc) Date: Thu, 8 Jan 2004 16:33:50 -0500 From: Craig Rodrigues To: Mark Linimon Message-ID: <20040108213350.GA41844@crodrigues.org> References: <200401081510.39015.linimon@lonesome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200401081510.39015.linimon@lonesome.com> User-Agent: Mutt/1.4.1i cc: freebsd-gnats-submit@FreeBSD.org cc: freebsd-standards@FreeBSD.org cc: harbour@netfang.net Subject: Re: ports/52016: New port: lang/harbour - A Clipper-compatible compiler 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, 08 Jan 2004 21:34:02 -0000 Hi, Look at the latest POSIX spec here: http://www.opengroup.org/onlinepubs/007904975/basedefs/unistd.h.html According to that web page, macros such as _POSIX_SYNCHRONIZED_IO can have values of -1, 0, or > 0. If the constant is defined to be -1, then that means the feature is not supported. ( This is what it is defined as on FreeBSD, insdie ). You need to change the code in your port to do something like: #if defined(_POSIX_SYNCHRONIZED_IO) && (_POSIX_SYNCHRONIZED_IO > 0) /* Use the fdatasync or whatever here */ #endif On Thu, Jan 08, 2004 at 03:10:39PM -0600, Mark Linimon wrote: > [mcl's cited compile error:] > > > ../../../../source/rtl/bsd/gcc/librtl.a(filesys.o): In function > > `hb_fsCommit': > > /usr/ports/lang/harbour/work/harbour/source/rtl/bsd/gcc/../../filesys.c:14 > >92: undefined reference to `fdatasync' > > [the submitter replied:] > > The hb_fsCommit function in filesys.c only attempts to use fdatasync if > _POSIX_SYNCHRONIZED_IO is defined, so this error appears to be due to a bug > in the POSIX library implementation in GCC on -current. The fdatasync > function is a POSIX function that appears to me to be mandated to be > present, even if unimplemented, if _POSIX_SYNCHRONIZED_IO is defined in > unistd.h. > > I'm not sure if I should add a FreeBSD-specific workaround for the second > error based on certain (currently unknown to me) values of __GNUC__ or > what... > > ------------------------------------------------------- > > _______________________________________________ > 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" -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-standards@FreeBSD.ORG Fri Jan 9 07:04:09 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 53B9716A4F9 for ; Fri, 9 Jan 2004 07:04:09 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id E263943D39 for ; Fri, 9 Jan 2004 07:04:06 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id CAA07781; Sat, 10 Jan 2004 02:03:57 +1100 Date: Sat, 10 Jan 2004 02:03:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Mark Linimon In-Reply-To: <200401081510.39015.linimon@lonesome.com> Message-ID: <20040110012527.S18300@gamplex.bde.org> References: <200401081510.39015.linimon@lonesome.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-standards@freebsd.org cc: postmaster@netfang.net Subject: Re: Fwd: Re: ports/52016: New port: lang/harbour - AClipper-compatible compiler 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, 09 Jan 2004 15:04:09 -0000 On Thu, 8 Jan 2004, Mark Linimon wrote: > Hello. I'm a ports committer trying to help a submitter get a port ready > for inclusion in the tree. This problem is clearly outside my league, so > any suggestions on how I can help him would be appreciated. > ---------- Forwarded Message ---------- > > [mcl's cited compile error:] > > > ../../../../source/rtl/bsd/gcc/librtl.a(filesys.o): In function > > `hb_fsCommit': > > /usr/ports/lang/harbour/work/harbour/source/rtl/bsd/gcc/../../filesys.c:14 > >92: undefined reference to `fdatasync' > > [the submitter replied:] > > The hb_fsCommit function in filesys.c only attempts to use fdatasync if > _POSIX_SYNCHRONIZED_IO is defined, so this error appears to be due to a bug > in the POSIX library implementation in GCC on -current. The fdatasync > function is a POSIX function that appears to me to be mandated to be > present, even if unimplemented, if _POSIX_SYNCHRONIZED_IO is defined in > unistd.h. _POSIX_SYNCRONIZED_IO is defined as -1, which means that this optional feature is not supported at all. From : % /* % * POSIX options and option groups we unconditionally do or don't % * implement. Those options which are implemented (or not) entirely % * in user mode are defined in . Please keep this list in % * alphabetical order. % * % * Anything which is defined as zero below **must** have an % * implementation for the corresponding sysconf() which is able to % * determine conclusively whether or not the feature is supported. % * Anything which is defined as other than -1 below **must** have ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ % * complete headers, types, and function declarations as specified by ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ % * the POSIX standard; however, if the relevant sysconf() function ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ % * returns -1, the functions may be stubbed out. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ % */ I vaguely remember that fdatasync() is a subset of _POSIX_SYNCHRONIZED_IO. fdatasync() is certainly not supported in FreeBSD, and the feature test macro is correctly defined to indicate this. The application's test of _POSIX_SYNCHRONIZED_IO is apparently broken. It must do something like testing for (_POSIX_SYNCHRONIZED_IO + 0) != -1 at compile time (not just "#ifdef _POSIX_SYNCHRONIZED_IO"), and according to the above, must also use sysconf() at runtime to see if the feature actually works. I don't remember the latter requirement in the standard, except in the following form: - if a feature test macro has value 0, then the feature might not be available and sysconf() must be used, as above. - at least old standards seem to permit feature test macros to have no value (they may be empty, or perhaps more bizarre). The "+ 0" in the above is to handle this case, so that feature test with an empty value work the same as ones with value 0. - if a feature test macro has value > 0, then the feature is fully present and need not be checked using sysconf(). POSIX feature tests macros are hard to use in their full generality (it takes about a page of code per macro just to ifdef all the cases). Practical applications would probably avoid most of these complications by only supporting fully dynamic or fully static configuration. E.g.: /* Fully static: */ /* Might "cache" the macro values in HAVE_FDATASYNC, etc. */ #if _POSIX_SYNCHRONIZED_IO + 0 > 0 fdatasync(fd); #elif _POSIX_FSYNC + 0 > 0 fsync(fd); #else err(1, "system might not support fdatsync() or fsync()"); #endif /* Fully dynamic: */ /* Might cache the sysconf() values in have_fdatasync, etc. */ if (sysconf(_SC_SYNCHRONIZED_IO) > 0) fdatasync(fd); else if (sysconf(_SC_FSYNC) > 0) fdatasync(fd); err(1, "system does not support fdatsync() or fsync()"); #endif Bruce From owner-freebsd-standards@FreeBSD.ORG Fri Jan 9 08:42:51 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 F183C16A4CE for ; Fri, 9 Jan 2004 08:42:51 -0800 (PST) Received: from fafoe.narf.at (chello212186121237.14.vie.surfer.at [212.186.121.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id B15DF43D49 for ; Fri, 9 Jan 2004 08:42:50 -0800 (PST) (envelope-from stefan@fafoe.narf.at) Received: from wombat.fafoe.narf.at (wombat.fafoe.narf.at [192.168.1.42]) by fafoe.narf.at (Postfix) with ESMTP id 672843FA9; Fri, 9 Jan 2004 17:42:46 +0100 (CET) Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id 06C7A1D7; Fri, 9 Jan 2004 17:42:44 +0100 (CET) Date: Fri, 9 Jan 2004 17:42:44 +0100 From: Stefan Farfeleder To: Bruce Evans Message-ID: <20040109164241.GA596@wombat.fafoe.narf.at> References: <200401081510.39015.linimon@lonesome.com> <20040110012527.S18300@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040110012527.S18300@gamplex.bde.org> User-Agent: Mutt/1.5.5.1i cc: Mark Linimon cc: freebsd-standards@freebsd.org Subject: Re: Fwd: Re: ports/52016: New port: lang/harbour - AClipper-compatible compiler 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, 09 Jan 2004 16:42:52 -0000 On Sat, Jan 10, 2004 at 02:03:57AM +1100, Bruce Evans wrote: > - at least old standards seem to permit feature test macros to have no > value (they may be empty, or perhaps more bizarre). The "+ 0" in the > above is to handle this case, so that feature test with an empty value > work the same as ones with value 0. [...] > #if _POSIX_SYNCHRONIZED_IO + 0 > 0 Undefined identifiers are replaced with 0 in a #if directive. Maybe some ancient pre-C90 compilers didn't do that, but I think they can be ignored these days. Regards, Stefan Farfeleder From owner-freebsd-standards@FreeBSD.ORG Sat Jan 10 07:04:18 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 CE0BB16A4CE for ; Sat, 10 Jan 2004 07:04:18 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0FA543D4C for ; Sat, 10 Jan 2004 07:04:16 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id CAA14656; Sun, 11 Jan 2004 02:03:51 +1100 Date: Sun, 11 Jan 2004 02:03:50 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Stefan Farfeleder In-Reply-To: <20040109164241.GA596@wombat.fafoe.narf.at> Message-ID: <20040111014013.I22846@gamplex.bde.org> References: <200401081510.39015.linimon@lonesome.com> <20040110012527.S18300@gamplex.bde.org> <20040109164241.GA596@wombat.fafoe.narf.at> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Mark Linimon cc: freebsd-standards@freebsd.org Subject: Re: Fwd: Re: ports/52016: New port: lang/harbour -AClipper-compatible compiler 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, 10 Jan 2004 15:04:18 -0000 On Fri, 9 Jan 2004, Stefan Farfeleder wrote: > On Sat, Jan 10, 2004 at 02:03:57AM +1100, Bruce Evans wrote: > > > - at least old standards seem to permit feature test macros to have no > > value (they may be empty, or perhaps more bizarre). The "+ 0" in the > > above is to handle this case, so that feature test with an empty value > > work the same as ones with value 0. > > [...] > > > #if _POSIX_SYNCHRONIZED_IO + 0 > 0 > > Undefined identifiers are replaced with 0 in a #if directive. Maybe > some ancient pre-C90 compilers didn't do that, but I think they can be > ignored these days. I know :-), and consider it a style bug to not depend on this feature, but the above is to handle the case where _POSIX_SYNCHRONIZED_IO is defined to be . Then "_POSIX_SYNCHRONIZED_IO > 0" would expand to " > 0", which is a syntax error. I think this possibility is fixed in POSIX.1-2001. It clearly says that the feature test constants "shall be defined with a value" if they are defined at all. POSIX.1-1990 seems to only say what happens if they are defined with a value or are undefined, leaving open the possibility that they are defined to a non-value. Hmm, POSIX.1-2001 doesn't seem to require the value to be integral, except tacitly since they would not be usable in cpp expressions if they were floating point. Bruce From owner-freebsd-standards@FreeBSD.ORG Sat Jan 10 08:00:11 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 80EC216A4CE for ; Sat, 10 Jan 2004 08:00:11 -0800 (PST) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9FFF043D53 for ; Sat, 10 Jan 2004 08:00:09 -0800 (PST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost.nic.fr [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.9/8.12.9) with ESMTP id i0AG07Da088974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK CN=khavrinen.lcs.mit.edu issuer=SSL+20Client+20CA); Sat, 10 Jan 2004 11:00:08 -0500 (EST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.9/8.12.9/Submit) id i0AG07xl088971; Sat, 10 Jan 2004 11:00:07 -0500 (EST) (envelope-from wollman) Date: Sat, 10 Jan 2004 11:00:07 -0500 (EST) From: Garrett Wollman Message-Id: <200401101600.i0AG07xl088971@khavrinen.lcs.mit.edu> To: Bruce Evans In-Reply-To: <20040111014013.I22846@gamplex.bde.org> References: <200401081510.39015.linimon@lonesome.com> <20040110012527.S18300@gamplex.bde.org> <20040109164241.GA596@wombat.fafoe.narf.at> <20040111014013.I22846@gamplex.bde.org> X-Spam-Score: -19.8 () IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES X-Scanned-By: MIMEDefang 2.37 cc: freebsd-standards@freebsd.org Subject: Re: Fwd: Re: ports/52016: New port: lang/harbour-AClipper-compatible compiler 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, 10 Jan 2004 16:00:11 -0000 < said: > Hmm, POSIX.1-2001 doesn't seem to require the value to be integral, > except tacitly since they would not be usable in cpp expressions if > they were floating point. This would seem to be implicit, since sysconf() returns a long. -GAWollman From owner-freebsd-standards@FreeBSD.ORG Sat Jan 10 08:59:38 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 092C316A4EA for ; Sat, 10 Jan 2004 08:59:38 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2436543D2D for ; Sat, 10 Jan 2004 08:59:36 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id DAA23276; Sun, 11 Jan 2004 03:59:21 +1100 Date: Sun, 11 Jan 2004 03:59:20 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Garrett Wollman In-Reply-To: <200401101600.i0AG07xl088971@khavrinen.lcs.mit.edu> Message-ID: <20040111034814.D23655@gamplex.bde.org> References: <200401081510.39015.linimon@lonesome.com> <20040110012527.S18300@gamplex.bde.org> <20040111014013.I22846@gamplex.bde.org> <200401101600.i0AG07xl088971@khavrinen.lcs.mit.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-standards@FreeBSD.org Subject: Re: Fwd: Re: ports/52016: New port: lang/harbour-AClipper-compatible compiler 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, 10 Jan 2004 16:59:38 -0000 On Sat, 10 Jan 2004, Garrett Wollman wrote: > < said: > > > Hmm, POSIX.1-2001 doesn't seem to require the value to be integral, > > except tacitly since they would not be usable in cpp expressions if > > they were floating point. > > This would seem to be implicit, since sysconf() returns a long. It's tacit at best I think. Here is the most unclear part of POSIX.1-1990 in this area: %%% {_POSIX_JOB_CONTROL} If this symbol is defined, it indicates that the implementation supports job control. {_POSIX_SAVED_IDS} [similarly] %%% Note that it doesn't say that anything about a value. The unclearness is moot for these particular constants in POSIX.1-2001, since they are no longer optional and are required to have a value greater than 0. BTW, FreeBSD is perfectly non-POSIX.1-2001 conformant since it intentionally doesn't support the _POSIX_SAVED_IDS mistake. I hope "appropriate privilege" can be interpreted suitably weaselly to claim support without changing the behaviour. Bruce