From owner-freebsd-bugs@FreeBSD.ORG Mon Apr 25 18:00:24 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F738106564A for ; Mon, 25 Apr 2011 18:00:24 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0CEE78FC14 for ; Mon, 25 Apr 2011 18:00:24 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PI0NdU059938 for ; Mon, 25 Apr 2011 18:00:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p3PI0Nt0059937; Mon, 25 Apr 2011 18:00:23 GMT (envelope-from gnats) Date: Mon, 25 Apr 2011 18:00:23 GMT Message-Id: <201104251800.p3PI0Nt0059937@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Garrett Wollman Cc: Subject: Re: misc/156637: sys/types.h can't be included when _XOPEN_SOURCE is defined X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Garrett Wollman List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 18:00:24 -0000 The following reply was made to PR misc/156637; it has been noted by GNATS. From: Garrett Wollman To: streambag@streambag.se Cc: freebsd-gnats-submit@freebsd.org Subject: Re: misc/156637: sys/types.h can't be included when _XOPEN_SOURCE is defined Date: Mon, 25 Apr 2011 13:51:31 -0400 (EDT) >When including with _XOPEN_SOURCE defined to 500 or higher, compila >tion will fail with a message similar to this one (using clang, gcc fails with a > similar message): Which edition of the standard specifies ? It's not in my copy of Issue 6 (SUSv3) or Issue 7 (SUSv4). I'd say it's the application code that is in error. It should not be defining _XOPEN_SOURCE and then including (implementation private) header files which are not defined in the relevant standard. Do we seriously need to start writing our headers like: #include #ifndef __BSD_VISIBLE #error "This is a non-standard header, but you have specified strict standard compliance." #endif ? This probably goes along with my fix to which does: #ifdef __BSD_VISIBLE #error "Application defined preprocessor macro in the implementation namespace." #endif -GAWollman