Subject: port-amiga/3907: amiga/amiga/autoconf.c uses is_draco() outside "#ifdef DRACO"
To: None <gnats-bugs@gnats.netbsd.org>
From: None <frueauf@ira.uka.de>
List: netbsd-bugs
Date: 07/22/1997 16:33:17
>Number: 3907
>Category: port-amiga
>Synopsis: amiga/amiga/autoconf.c uses is_draco() outside "#ifdef DRACO"
encapsulation
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: gnats-admin (GNATS administrator)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Jul 22 07:50:02 1997
>Last-Modified:
>Originator: Thorsten Frueauf
>Organization:
private
>Release: <NetBSD-current source date> NetBSD current 20.07.1997
>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 ----
>Audit-Trail:
>Unformatted:
amiga/amiga/autoconf.c uses is_draco() outside "#ifdef DRACO" encapsulation