Subject: misc/21317: abuses _POSIX_SOURCE
To: None <>
From: Ben Harris <>
List: netbsd-bugs
Date: 04/25/2003 11:49:35
>Number:         21317
>Category:       misc
>Synopsis:       <sys/midiio.h> abuses _POSIX_SOURCE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 25 10:50:00 UTC 2003
>Originator:     Ben Harris
>Release:        2003-04-25
<sys/midiio.h> includes the following:

#define _POSIX_SOURCE           /* make sure we don't get all the gunk */
#include <machine/endian.h>

This is horribly broken, since it means that if the user subsequently
includes <machine/endian.h> themselves, they won't get any of the extra
NetBSD facilities it provides.  If it's necessary to avoid trampling the
user's namespace when using <sys/midiio.h>, then this should be done by
either splitting <sys/endian.h> into "clean" and "dirty" halves, or by
using the feature-test macro for whatever standard defines <sys/midiio.h>.

Code inspection.  The only header that has _any_ business modifying
feature-test macros is <sys/featuretest.h>.  Everything else should treat
them as read-only.