Date: Wed, 27 Apr 2011 19:30:12 GMT From: Robert Andersson <streambag@streambag.se> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/156637: sys/types.h can't be included when _XOPEN_SOURCE is defined Message-ID: <201104271930.p3RJUCUT087746@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/156637; it has been noted by GNATS. From: Robert Andersson <streambag@streambag.se> To: Garrett Wollman <wollman@hergotha.csail.mit.edu> Cc: freebsd-gnats-submit@freebsd.org Subject: Re: misc/156637: sys/types.h can't be included when _XOPEN_SOURCE is defined Date: Wed, 27 Apr 2011 21:22:55 +0200 On Mon, 25 Apr 2011 13:51:31 -0400 (EDT) Garrett Wollman <wollman@hergotha.csail.mit.edu> wrote: > >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 > I think you are right. I was confused about what _XOPEN_SOURCE meant. By the way, I solved the problem by making sure that the application only uses standardized headers. In this case it meant using fcntl instead of flock. Hopefully, I will be able to push that upstream. As far as I'm concerned, this PR can be closed. Thanks for your help and sorry for the noise. / Robert
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104271930.p3RJUCUT087746>