NetBSD Problem Report #1927
From gnats Thu Jan 11 09:57:58 1996
Received: from arhpc214.uni-c.dk by pain.lcs.mit.edu (8.6.12/8.6.9) with ESMTP id JAA18057 for <gnats-bugs@gnats.netbsd.org>; Thu, 11 Jan 1996 09:55:06 -0500
Message-Id: <199601111555.QAA01220@arhpc214.uni-c.dk>
Date: Thu, 11 Jan 1996 16:55:23 +0100
From: Erik Bertelsen <erik@arhpc214.uni-c.dk>
Reply-To: erik@sockdev.uni-c.dk
To: gnats-bugs@gnats.netbsd.org
Subject: 386 kernel fails to build with options DEBUG
X-Send-Pr-Version: 3.95
>Number: 1927
>Category: port-i386
>Synopsis: 386 kernel fails to build with options DEBUG in configuration file
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: gnats-admin
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jan 11 10:05:01 +0000 1996
>Closed-Date: Fri Jan 12 00:53:04 +0000 1996
>Last-Modified: Fri Jan 12 00:54:50 +0000 1996
>Originator: Erik Bertelsen
>Release: NetBSD-current 10-jan-1996
>Organization:
UNI-C
>Environment:
System: NetBSD arhpc214.uni-c.dk 1.1A NetBSD 1.1A (EBE) #6: Tue Dec 19 12:32:29 MET 1995 erik@arhpc214.uni-c.dk:/usr/sup/netbsd/src/sys/arch/i386/compile/EBE i386
>Description:
Kernel build fails with following compiler error message:
ERIC -D_KERNEL -Di386 ../../../../dev/isa/wt.c
../../../../dev/isa/wt.c:74: warning: `DEBUG' redefined
*Initialization*:1: warning: this is the location of the previous definition
*** Error code 1
The reason for this is that the C standard requires a diagnostic if a macro is defined
several times, but not with the exactly same replacement text. After the addition
of -Werror to the compiler call, this now causes the bove error message.
In fact in this file, DEBUG is defined and used as a macro
with parameters and not just as a flag to in/exclude debug
code.
Suggested fix: rename the DEBUG macro in wt.c to e.g. DEBUGPRINT.
>How-To-Repeat:
Configure a kernel with "option DEBUG" in the kernel configuration file
and try to compile it. Or just use the BOATANCHOR configuration file.
>Fix:
Most other kernel files uses DEBUG as a flag (if atall used). wt.c is different as it
uses DEBUG as an internal macro with a parameter and expands it in a lot of places.
Suggested Fix: rename DEBUG to e.g. DODEBUG in this source file.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: thorpej
State-Changed-When: Thu Jan 11 16:53:04 PST 1996
State-Changed-Why:
Fixed.
>Unformatted:
(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.