Subject: port-amiga/2114: &kernel_exec needs to be casted in amiga_init.c
To: None <gnats-bugs@NetBSD.ORG>
From: Thorsten Frueauf <frueauf@ira.uka.de>
List: netbsd-bugs
Date: 02/23/1996 17:15:14
>Number:         2114
>Category:       port-amiga
>Synopsis:       &kernel_exec needs to be casted in amiga_init.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 23 12:05:01 1996
>Last-Modified:
>Originator:     Thorsten Frueauf
>Organization:
private
>Release:        <NetBSD-current source date> NetBSD current 22.02.1996
>Environment:
	
System: NetBSD di_frueauf 1.1A NetBSD 1.1A (CYBERDYNE) #0: Thu Feb 15 22:48:00 GMT 1996 milano@di_frueauf:/home/milano/source/netbsd-src/sys/arch/amiga/compile/CYBERDYNE amiga


>Description:
	
&kernel_exec needs to be casted to (caddr_t) in
/src/sys/arch/amiga/amiga/amiga_init.c else the kernel won't compile with
-Werror turned on.
>How-To-Repeat:
	
Try to compile a kernel on an Amiga and watch:

cc  -O2 -Werror -mc68020 -msoft-float -I. -I../../../../arch -I../../../.. -DTIM
EZONE="0" -DDST="1" -DNMBCLUSTERS="0x400" -DM68030 -DM68020 -DFPCOPROC -DSWAPPAG
ER -DVNODEPAGER -DDEVPAGER -DINET -DIPFILTER -DGATEWAY -DDIRECTED_BROADCAST -DMR
OUTING -DNFSSERVER -DNFSCLIENT -DFFS -DMFS -DPROCFS -DKERNFS -DFDESC -DNULLFS -D
FIFO -DADOSFS -DCD9660 -DUNION -DUMAPFS -DCOMPAT_10 -DCOMPAT_09 -DCOMPAT_43 -DCO
MPAT_SUNOS -DTCP_COMPAT_42 -DCOMPAT_NOMID -DSYSVSHM -DSYSVMSG -DSYSVSEM -DGENERI
C -DLKM -DKTRACE -DDIAGNOSTIC -DNKMEMCLUSTERS=256 -DPANICWAIT -DDEBUG -DDDB -DKB
DRESET -DMACHINE_NONCONTIG -DCL5426CONSOLE -DGRF_ECS -DGRF_NTSC -DGRF_PAL -DGRF_
CL5426 -D_KERNEL -Dmc68020 -Damiga  -c ../../../../arch/amiga/amiga/amiga_init.c
cc1: warnings being treated as errors
../../../../arch/amiga/amiga/amiga_init.c: In function `kernel_reload_write':
../../../../arch/amiga/amiga/amiga_init.c:728: warning: passing arg 1 of `uiomov
e' from incompatible pointer type
*** Error code 1
>Fix:
	
Apply the followin patch:

*** amiga_init.c-orig   Tue Dec 12 15:43:43 1995
--- amiga_init.c        Thu Feb 15 16:47:25 1996
***************
*** 725,731 ****
                /*
                 * Pull in the exec header and check it.
                 */
!               if (error = uiomove(&kernel_exec, sizeof(kernel_exec), uio))
                        return(error);
                printf("loading kernel %d+%d+%d+%d\n", kernel_exec.a_text,
                        kernel_exec.a_data, kernel_exec.a_bss,
--- 725,731 ----
                /*
                 * Pull in the exec header and check it.
                 */
!               if (error = uiomove((caddr_t)&kernel_exec, sizeof(kernel_exec), 
uio))
                        return(error);
                printf("loading kernel %d+%d+%d+%d\n", kernel_exec.a_text,
                        kernel_exec.a_data, kernel_exec.a_bss,
>Audit-Trail:
>Unformatted:
&kernel_exec needs to be casted in /src/sys/arch/amiga/amiga/amiga_init.c
sw-bug