From owner-freebsd-standards Thu Mar 6 10:49:53 2003 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 B491D37B401; Thu, 6 Mar 2003 10:49:50 -0800 (PST) Received: from mailout05.sul.t-online.com (mailout05.sul.t-online.com [194.25.134.82]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00C5C43F3F; Thu, 6 Mar 2003 10:49:49 -0800 (PST) (envelope-from corecode@corecode.ath.cx) Received: from fwd08.sul.t-online.de by mailout05.sul.t-online.com with smtp id 18r0R9-0004ww-03; Thu, 06 Mar 2003 19:49:47 +0100 Received: from pride.uni.stoert.net (320050403952-0001@[217.82.60.93]) by fmrl08.sul.t-online.com with esmtp id 18r0Qu-1fCq4eC; Thu, 6 Mar 2003 19:49:32 +0100 Received: from terrorfish.uni.stoert.net (terrorfish.uni.stoert.net [10.150.180.178]) by pride.uni.stoert.net (Postfix) with ESMTP id 764B0130C06; Thu, 6 Mar 2003 19:49:32 +0100 (CET) Received: from terrorfish.uni.stoert.net (localhost [127.0.0.1]) by terrorfish.uni.stoert.net (8.12.7/8.12.7) with ESMTP id h26InodN067787; Thu, 6 Mar 2003 19:49:50 +0100 (CET) (envelope-from corecode@terrorfish.uni.stoert.net) Received: (from corecode@localhost) by terrorfish.uni.stoert.net (8.12.7/8.12.7/Submit) id h26Innjw067782; Thu, 6 Mar 2003 19:49:49 +0100 (CET) (envelope-from corecode) Date: Thu, 6 Mar 2003 19:49:45 +0100 From: "Simon 'corecode' Schubert" To: standards@freebsd.org Cc: Mike Barcroft , markm@freebsd.org Subject: Re: cvs commit: src/sys/sys stat.h Message-Id: <20030306194945.126c092f.corecode@corecode.ath.cx> In-Reply-To: <200302262010.h1QKAsMT007004@repoman.freebsd.org> References: <200302262010.h1QKAsMT007004@repoman.freebsd.org> Reply-To: standards@freebsd.org, corecode@corecode.ath.cx X-Mailer: Sylpheed version 0.8.10claws93 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="=.n.n8Fy3e('0fOY" X-Sender: 320050403952-0001@t-dialin.net Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=.n.n8Fy3e('0fOY Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Lately Mike Barcroft told: > mike 2003/02/26 12:10:54 PST > > Modified files: > sys/sys stat.h > Log: > Change spelling of `u_int' to `unsigned int' in the POSIX case. if this catched the POSIX case it would be good. bad thing is it doesn't catch it. imagine: % cat < stattest.c #define _XOPEN_SOURCE 600 #include #include EOF % cc -c stattest.c In file included from stattest.c:4: /usr/include/sys/stat.h:127: syntax error before "u_int" /usr/include/sys/stat.h:158: syntax error before "u_int" problem here is: _XOPEN_SOURCE defines _POSIX_C_SOURCE but NOT _POSIX_SOURCE which is being checked for in many places in the source tree: % grep -r '#if.*_POSIX_SOURCE' /usr/include | wc -l 73 a possible fix could be: Index: sys/sys/cdefs.h =================================================================== RCS file: /home/ncvs/src/sys/sys/cdefs.h,v retrieving revision 1.68 diff -u -r1.68 cdefs.h --- sys/sys/cdefs.h 21 Oct 2002 20:50:30 -0000 1.68 +++ sys/sys/cdefs.h 6 Mar 2003 17:35:23 -0000 @@ -341,6 +341,8 @@ #define _POSIX_C_SOURCE 198808 #endif #ifdef _POSIX_C_SOURCE +#undef _POSIX_SOURCE +#define _POSIX_SOURCE 1 #if _POSIX_C_SOURCE >= 200112 #define __POSIX_VISIBLE 200112 #define __ISO_C_VISIBLE 1999 but as i'm writing this patch shows other (mis?)usage of _POSIX_SOURCE: [snip math.h] #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) #define M_E 2.7182818284590452354 /* e */ [...] now stuff breaks here. what's the proper fix? changing all headers so that _POSIX_SOURCE isn't used anymore (only _POSIX_VISIBLE and/or _POSIX_C_SOURCE)? cheers simon ps: please cc me as i'm not subscribed. reply-to headers set tho -- /"\ http://corecode.ath.cx/#donate \ / \ ASCII Ribbon Campaign / \ Against HTML Mail and News --=.n.n8Fy3e('0fOY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+Z5hNr5S+dk6z85oRAurKAKD1rcPV5eU9TJ1igy5Yxv7Q2VJtSwCfWKx4 3Peu5stNFxtrGl6v3+qryp4= =ZJSJ -----END PGP SIGNATURE----- --=.n.n8Fy3e('0fOY-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message