From owner-freebsd-hackers Sun Apr 20 23:35:47 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id XAA19495 for hackers-outgoing; Sun, 20 Apr 1997 23:35:47 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA19487 for ; Sun, 20 Apr 1997 23:35:44 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id QAA23521; Mon, 21 Apr 1997 16:31:12 +1000 Date: Mon, 21 Apr 1997 16:31:12 +1000 From: Bruce Evans Message-Id: <199704210631.QAA23521@godzilla.zeta.org.au> To: bde@freefall.freebsd.org, thorpej@nas.nasa.gov Subject: Re: cvs commit: src/sys/i386/include endian.h Cc: freebsd-hackers@freebsd.org Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > Don't pollute the namespace if _POSIX_SOURCE is defined. This is > > broken - it makes almost everything in inaccessible > > if _POSIX_SOURCE is defined, yet is not a POSIX > > header. Other systems don't do it any better. > >...there's a very good reason to protect the namespace: > >basalt (thorpej) ~ 202% uname -sm ; grep endian.h /sys/sys/types.h >NetBSD hp300 >#include That's why the namspace protection implementation is broken. After #define _POSIX_SOURCE 1 /* protect namespace */ #include /* or anything that includes this */ #undef _POSIX_SOURCE /* unprotect namespace */ the idempotency ifdef prevents further inclusions of , not , to get endian features. This permits a better implementation (except for being inherently namespace-polluting). NetBSD has fixed the man page. Bruce