NetBSD Problem Report #3907

Received: (qmail 18387 invoked from network); 22 Jul 1997 14:37:39 -0000
Message-Id: <199707221433.QAA21222@di-frueauf.ira.uka.de>
Date: Tue, 22 Jul 1997 16:33:17 +0200 (CEST)
From: frueauf@ira.uka.de
Reply-To: frueauf@ira.uka.de
To: gnats-bugs@gnats.netbsd.org
Subject: amiga/amiga/autoconf.c uses is_draco() outside "#ifdef DRACO" 
         encapsulation
X-Send-Pr-Version: 3.95

>Number:         3907
>Category:       port-amiga
>Synopsis:       amiga/amiga/autoconf.c uses is_draco() outside "#ifdef DRACO"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 22 07:50:02 +0000 1997
>Closed-Date:    Tue Jul 22 14:56:15 +0000 1997
>Last-Modified:  Tue Jul 22 15:07:10 +0000 1997
>Originator:     Thorsten Frueauf
>Release:        <NetBSD-current source date> NetBSD current 20.07.1997
>Organization:
private
>Environment:

System: NetBSD di-frueauf 1.2G NetBSD 1.2G (CYBERDYNE) #13: Fri Jul 18 18:11:58 CEST 1997 root@di-frueauf:/usr/src/sys/arch/amiga/compile/CYBERDYNE amiga


>Description:

/src/sys/arch/amiga/amiga/autoconf.c uses is_draco() outside
"#ifdef DRACO" encapsulation, and thus fails to compile.

>How-To-Repeat:

Try to compile a kernel on current NetBSD/amiga and watch:

cc  -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -m68060 -Wa,-m68030 -msoft-float -I. -I../../../../arch -I../../../.. -nostdinc -DSWAPPAGER -DVNODEPAGER -DDEVPAGER -DEXEC_AOUT -DEXEC_SCRIPT -DRTC_OFFSET="0" -DNMBCLUSTERS="0x400" -DM68060 -DM060SP -DM68030 -DFPCOPROC -DINET -DGATEWAY -DDIRECTED_BROADCAST -DMROUTING -DPFIL_HOOKS -DIPFILTER_LOG -DFFS -DMFS -DNFS -DADOSFS -DCD9660 -DMSDOSFS -DFDESC -DKERNFS -DNULLFS -DPROCFS -DUMAPFS -DUNION -DNFSSERVER -DFIFO -DQUOTA -DTCP_COMPAT_42 -DCOMPAT_43 -DCOMPAT_09 -DCOMPAT_10 -DCOMPAT_12 -DCOMPAT_SUNOS -DCOMPAT_NOMID -DSYSVSHM -DSYSVMSG -DSYSVSEM -DKTRACE -DNKMEMCLUSTERS="0x100" -DUCONSOLE -DBB060STUPIDROM -DMACHINE_NONCONTIG -DKBDRESET -DSERIBUF_SIZE="0x1000" -DSEROBUF_SIZE="0x20" -DCL5426CONSOLE -DMAXUSERS=16 -D_KERNEL  -Dmc68020 -Damiga  -c ../../../../arch/amiga/amiga/autoconf.c
cc1: warnings being treated as errors
../../../../arch/amiga/amiga/autoconf.c: In function `mbattach':
../../../../arch/amiga/amiga/autoconf.c:255: warning: implicit declaration of function `is_draco'
*** Error code 1

>Fix:

Two possibilities:

1) rework the "if (!is_draco() && !is_a1200())" part and encapsulate it
   with "#ifdef DRACO" when using is_draco().

2) why is is_draco() only defined when DRACO is defined? Just define it
   always - should not hurt - others are too.

Here is the patch for solution 2, which I prefred:

*** autoconf.c-orig	Tue Jul 22 16:20:01 1997
--- autoconf.c	Tue Jul 22 16:20:01 1997
***************
*** 536,542 ****
  	return (0);			/* Machine type not set */
  }

- #ifdef DRACO
  int
  is_draco()
  {
--- 536,541 ----
***************
*** 544,547 ****
  		return ((machineid >> 16) & 0xFF);
  	return (0);
  }
- #endif
--- 543,545 ----
*** cpu.h-orig	Tue Jul 22 16:20:20 1997
--- cpu.h	Tue Jul 22 16:20:20 1997
***************
*** 156,164 ****
  int	is_a1200 __P((void));
  int	is_a3000 __P((void));
  int	is_a4000 __P((void));
- #ifdef DRACO
  int	is_draco __P((void));
- #endif

  /*
   * Prototypes from clock.c
--- 156,162 ----
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: is 
State-Changed-When: Tue Jul 22 07:56:15 PDT 1997 
State-Changed-Why:  
Fixed, using method 1). 
>Unformatted:
         encapsulation
 amiga/amiga/autoconf.c uses is_draco() outside "#ifdef DRACO" encapsulation

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.