NetBSD Problem Report #2813

Received: (qmail-queue invoked from smtpd); 7 Oct 1996 04:12:03 -0000
Message-Id: <199610070359.NAA11149@balrog.supp.cpr.itg.telecom.com.au>
Date: Mon, 7 Oct 1996 13:59:54 +1000
From: Simon Burge <simonb@telstra.com.au>
Reply-To: Simon Burge <simonb@telstra.com.au>
To: gnats-bugs@gnats.netbsd.org
Subject: TRUE/FALSE declarations unguarded in sys/vm/vm_param.h
X-Send-Pr-Version: 3.95

>Number:         2813
>Category:       kern
>Synopsis:       TRUE/FALSE declarations unguarded in sys/vm/vm_param.h
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 06 21:20:00 +0000 1996
>Closed-Date:    Sun Apr 11 01:00:01 +0000 1999
>Last-Modified:  Sun Apr 11 01:00:20 +0000 1999
>Originator:     Simon Burge
>Release:        1.2
>Organization:
	Telstra, Australia
>Environment:
System: NetBSD mona 1.2 NetBSD 1.2 (MONA) #1: Fri Oct 4 15:51:13 EST 1996 simonb@mona:/usr/src/sys/arch/pmax/compile/MONA pmax


>Description:
	The defines of TRUE and FALSE in /usr/src/sys/vm/vm_param.h
	do not check to see if TRUE and FALSE are already defined.
>How-To-Repeat:
	I found the bug playing around with sysctl().  <sys/sysctl.h>
	include <vm/vm.h>, which in turn includes <vm/vm_param.h>.
	For a shorter version, compile the following:

		#include <curses.h>
		#include <vm/vm_param.h>

		main() {}

	Watch warnings.
>Fix:
	Apply the following patch.  If people are really worried
	the "the kernel should do what it wants", at least a

		#ifdef TRUE
		#undef TRUE
		#endif

	type thing would do...

*** usr/src/sys/vm/vm_param.h.ORIG	Sat Oct 14 12:59:00 1995
--- usr/src/sys/vm/vm_param.h	Mon Oct  7 13:54:21 1996
***************
*** 77,84 ****
   * This belongs in types.h, but breaks too many existing programs.
   */
  typedef int	boolean_t;
! #define	TRUE	1
! #define	FALSE	0

  /*
   *	The machine independent pages are refered to as PAGES.  A page
--- 77,88 ----
   * 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
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: simonb 
State-Changed-When: Sat Apr 10 18:00:01 PDT 1999 
State-Changed-Why:  
Fixed as suggested. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.