Subject: Re: elink3 bites (was Re: new i386 snapshot (finally))
To: None <port-i386@NetBSD.ORG>
From: Simon J. Gerraty <sjg@quick.com.au>
List: port-i386
Date: 07/13/1997 14:33:19
I've lost track of the thread that discussed the gcc bug hitting elink3.o
But now that I've got 1.2G up and running (thanks to
Havard.Eidnes@runit.sintef.no) I figured I'd compile a kernel that
matched my hardware...  the following may or may not be of interest.

I just let make build the kernel and then:

root:13# rm elink3.o 
root:14# make COPTS=-O
cc  -O -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -I. -I../../../../arch -I../../../.. -nostdinc -DSWAPPAGER -DVNODEPAGER -DDEVPAGER -DEXEC_AOUT -DEXEC_SCRIPT -DI386_CPU -DI486_CPU -DI586_CPU -DI686_CPU -DVM86 -DDUMMY_NOPS -DXSERVER -DUCONSOLE -DINSECURE -DRTC_OFFSET="0x258" -DDIAGNOSTIC -DKTRACE -DSYSVMSG -DSYSVSEM -DSYSVSHM -DCOMPAT_NOMID -DCOMPAT_09 -DCOMPAT_10 -DCOMPAT_11 -DCOMPAT_12 -DCOMPAT_43 -DTCP_COMPAT_42 -DCOMPAT_SVR4 -DCOMPAT_IBCS2 -DCOMPAT_LINUX -DCOMPAT_FREEBSD -DEXEC_ELF32 -DUSER_LDT -DLKM -DFFS -DEXT2FS -DMFS -DNFS -DCD9660 -DMSDOSFS -DFDESC -DKERNFS -DNULLFS -DPROCFS -DUMAPFS -DUNION -DQUOTA -DNFSSERVER -DFIFO -DINET -DPCIVERBOSE -DMAXUSERS=64 -D_KERNEL  -Di386  -c ../../../../dev/ic/elink3.c
cc1: warnings being treated as errors
../../../../dev/ic/elink3.c: In function `epbusyeeprom':
../../../../dev/ic/elink3.c:1582: warning: `j' might be used uninitialized in this function
*** Error code 1

Stop.

The warning is of course wrong - in the absence of any optimizing, the
while loop which causes j to be initialized will be run at least once
before j is used....

Trying COPTS= (ie no optimization), results in dozens of warnings
about foo defined but not used.

Using -O2 (default), it compiles ok.

root:15# make          
cc  -O2 -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -I. -I../../../../arch -I../../../.. -nostdinc -DSWAPPAGER -DVNODEPAGER -DDEVPAGER -DEXEC_AOUT -DEXEC_SCRIPT -DI386_CPU -DI486_CPU -DI586_CPU -DI686_CPU -DVM86 -DDUMMY_NOPS -DXSERVER -DUCONSOLE -DINSECURE -DRTC_OFFSET="0x258" -DDIAGNOSTIC -DKTRACE -DSYSVMSG -DSYSVSEM -DSYSVSHM -DCOMPAT_NOMID -DCOMPAT_09 -DCOMPAT_10 -DCOMPAT_11 -DCOMPAT_12 -DCOMPAT_43 -DTCP_COMPAT_42 -DCOMPAT_SVR4 -DCOMPAT_IBCS2 -DCOMPAT_LINUX -DCOMPAT_FREEBSD -DEXEC_ELF32 -DUSER_LDT -DLKM -DFFS -DEXT2FS -DMFS -DNFS -DCD9660 -DMSDOSFS -DFDESC -DKERNFS -DNULLFS -DPROCFS -DUMAPFS -DUNION -DQUOTA -DNFSSERVER -DFIFO -DINET -DPCIVERBOSE -DMAXUSERS=64 -D_KERNEL  -Di386  -c ../../../../dev/ic/elink3.c
making sure the kern library is up to date...

I better go find that patch.

--sjg
-- 
Simon J. Gerraty        <sjg@quick.com.au>

#include <disclaimer>   /* imagine something _very_ witty here */