missing types
To: None <gnats-bugs@gnats.netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: netbsd-bugs
Date: 08/13/1998 12:05:56
>Number: 5961
>Category: lib
>Synopsis: [dM] <unistd.h> missing types
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: lib-bug-people (Library Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Aug 13 09:20:01 1998
>Last-Modified:
>Originator: der Mouse
>Organization:
Dis-
>Release: 1.3F
>Environment:
System: NetBSD Callisto.McRCIM.McGill.EDU 1.3F NetBSD 1.3F (GENERIC) #0: Tue Aug 4 14:43:07 EDT 1998 mouse@Callisto.McRCIM.McGill.EDU:/sources/working-usr-src/sys/arch/sparc/compile/GENERIC sparc
...or any with <unistd.h> 1.66 and <sys/types.h> 1.34 (code inspection
implies <sys/types.h> 1.35, ie, -current, as well)
>Description:
Under certain conditions, <unistd.h> uses fd_set and u_long
without ensuring they're defined. I haven't followed the
twisty little maze of include files fully, but I have two test
cases (see below). This actually arose when someone else was
trying to build a certain X release (not the NetBSD one) and
asked me for help with these errors. The problem is not
directly X-related, though.
>How-To-Repeat:
% echo '#include <unistd.h>' > z.c
% cc -D_XOPEN_SOURCE=500 -c z.c
In file included from z.c:1:
/usr/include/unistd.h:269: syntax error before `fd_set'
%
% cat > zz.c
/* This is a very stripped-down version of the
offending file from the attempted X build. */
#include <stdio.h>
#include <ctype.h>
#define _POSIX_SOURCE
#include <unistd.h>
<EOF>
% cc -ansi -c zz.c
In file included from zz.c:4:
/usr/include/unistd.h:269: syntax error before `fd_set'
/usr/include/unistd.h:300: syntax error before `u_long'
%
>Fix:
Something needs to be redone in the way <unistd.h> and
<sys/types.h> play with the various test macros like
_POSIX_SOURCE and __STRICT_ANSI__....
der Mouse
mouse@rodents.montreal.qc.ca
7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
>Audit-Trail:
>Unformatted: