From owner-freebsd-standards Sun Dec 8 13:13:46 2002 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 3EC0737B401 for ; Sun, 8 Dec 2002 13:13:44 -0800 (PST) Received: from popelschnipser.de (ultrakoreggd.org [217.160.78.206]) by mx1.FreeBSD.org (Postfix) with SMTP id 7158843EA9 for ; Sun, 8 Dec 2002 13:13:37 -0800 (PST) (envelope-from marc@informatik.uni-bremen.de) Received: (qmail 11457 invoked by uid 1048); 8 Dec 2002 21:13:35 -0000 Received: from marc@informatik.uni-bremen.de by p10089345 by uid 1045 with qmail-scanner-1.15 (clamscan: 0.54. spamassassin: 2.42. Clear:. Processed in 0.762984 secs); 08 Dec 2002 21:13:35 -0000 Received: from unknown (HELO ?192.168.100.100?) (217.227.199.133) by ultrakoreggd.org with SMTP; 8 Dec 2002 21:13:34 -0000 Date: Sun, 08 Dec 2002 22:13:33 +0100 From: Marc Recht To: David Schultz Cc: freebsd-standards@FreeBSD.ORG Subject: Re: POSIX and the real life or FreeBSD too strict ? Message-ID: <758430000.1039382013@leeloo.intern.geht.de> In-Reply-To: <20021208203949.GA535@HAL9000.homeunix.com> References: <584000000.1039360297@leeloo.intern.geht.de> <20021208203949.GA535@HAL9000.homeunix.com> X-Mailer: Mulberry/3.0.0b9 (Linux/x86) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="==========1354966650==========" 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 --==========1354966650========== Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline > What you're asking for is reasonable, but there's a problem of > namespace pollution. A application that uses only POSIX features > is supposed to compile on a conforming implementation when > _POSIX_C_SOURCE is appropriately defined. If standard headers add > extra symbols and macros that are not specified in POSIX, you > can't make that guarantee due to potential name conflicts. The > whole point of using _POSIX_SOURCE is to turn of extensions that > might break things. I don't say that there might be a perfect solution, but breaking source=20 compatibility to other UNIX implementation is IMHO worse. > By the way, Solaris also has the behavior you're complaining > about, but there is a workaround. If you define _POSIX_C_SOURCE, Hmm, not from my last experiences.. (But, I'm not doing that much on=20 Solaris.) > you get precisely the features specified in POSIX, and if you > additionally define __EXTENSIONS__, you get everything. I'm not IMHO something like that is absolutly neccessary. > sure what ``other UNIX implementations'' you've been looking at, > but a cursory glance at glibc reveals that it is in the same boat > as FreeBSD. I've tried the following two sources on FreeBSD-current (today), FreeBSD=20 4.7-RC, NetBSD 1.6 (gcc2.95), Solaris 8/Sparc (gcc 3.0) and Gentoo Linux (gcc 3.2, today). gcc -D_POSIX_C_SOURCE=3D200112L -D_XOPEN_SOURCE_=3D600=20 -D_XOPEN_SOURCE_EXTENDED=3D1 On -current both sources can't be compiled. On FreeBSD 4.x the first can't=20 be compiled (because of _SC_PAGE_SIZE). All other OSes compiled them just=20 fine. 1) #include #include int main() { long l =3D 0; l =3D sysconf(_SC_PAGE_SIZE); printf ("\nsize: %ld\n", l); return 0; } 2) #include #include int main() { return 0; } Regards, Marc "Premature optimization is the root of all evil." -- Donald E. Knuth --==========1354966650========== Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE987X97YQCetAaG3MRAsMwAKCIrNAx4UU25nrBSdMqoFG9xfDKFACfWcXM Diqjdhj5yUPwYnpmY3Mm57A= =GgMd -----END PGP SIGNATURE----- --==========1354966650==========-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message