Subject: misc/7356: vm/vm_param.h defines true. badly.
To: None <gnats-bugs@gnats.netbsd.org>
From: TheMan <andrew@untraceable.net>
List: netbsd-bugs
Date: 04/10/1999 18:36:32
>Number: 7356
>Category: misc
>Synopsis: vm/vm_param.h defines TRUE unconditionally
>Confidential: no
>Severity: non-critical
>Priority: high
>Responsible: misc-bug-people (Misc Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Apr 10 15:50:00 1999
>Last-Modified:
>Originator: TheMan
>Organization:
me, myslef, undt i
>Release: (at least) 1.3.3 up to -current
>Environment:
System: NetBSD noc 1.3.3 NetBSD 1.3.3 (LINGAM) #0: Sat Mar 6 23:57:16 EST 1999 root@:/usr/src/sys/arch/i386/compile/LINGAM i386
>Description:
compile a program that includes both <sys/sysctl.h> and <rpc/rpc.h>
(like, say, lsof?) in that order watch the compiler whine about TRUE.
rpc/rpc.h ultimately includes rpc/types.h and sys/sysctl.h ultimately
includes vm/vm_param.h. these are the sources of the identical (to
me) conflicting definitions of TRUE. rpc/types.h is nice about it and
checks #ifndef first, but vm/vm_param.h is just plain rude. it should
be more polite.
>How-To-Repeat:
download lsof. skip the package system (which doesn't seem to work
around this anyway). configure and compile it. enjoy compiler spew.
>Fix:
--- vm_param.h.orig Wed Mar 24 07:21:53 1999
+++ vm_param.h Sat Apr 10 18:26:41 1999
@@ -77,8 +77,12 @@
* This belongs in types.h, but breaks too many existing programs.
*/
typedef int boolean_t;
+#ifndef TRUE
#define TRUE 1
+#endif
+#ifndef FALSE
#define FALSE 0
+#endif
/*
* The machine independent pages are refered to as PAGES. A page
>Audit-Trail:
>Unformatted: