misc/156637: sys/types.h can't be included when _XOPEN_SOURCE is defined

Garrett Wollman wollman at hergotha.csail.mit.edu
Mon Apr 25 18:00:24 UTC 2011


The following reply was made to PR misc/156637; it has been noted by GNATS.

From: Garrett Wollman <wollman at hergotha.csail.mit.edu>
To: streambag at streambag.se
Cc: freebsd-gnats-submit at 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 <sys/file.h> 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 <sys/file.h>?  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 <sys/cdefs.h>
 #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 <sys/cdefs.h> which does:
 
 #ifdef __BSD_VISIBLE
 #error "Application defined preprocessor macro in the implementation namespace."
 #endif
 
 -GAWollman 


More information about the freebsd-bugs mailing list