Subject: Re: kern/35364: Kernel compile fails due to code warning on sys/net/if_ethersubr.c
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-bugs
Date: 01/06/2007 16:25:02
The following reply was made to PR kern/35364; it has been noted by GNATS.

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
	netbsd-bugs@NetBSD.org
Subject: Re: kern/35364: Kernel compile fails due to code warning on sys/net/if_ethersubr.c
Date: Sat, 6 Jan 2007 15:51:22 +0100

 --nFreZHaLTZJo0R7j
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Sat, Jan 06, 2007 at 03:27:00PM +0100, Manuel Bouyer wrote:
 > On Sat, Jan 06, 2007 at 01:05:00AM +0000, yancm@sdf.lonestar.org wrote:
 > > For about the last 2-3 weeks, I have been unable to build the kernel from a clean CVS. The fix is aparently trivial - comment or delete line 1034 to eliminate the unused label statement.
 > > 
 > > The build.sh job fails with:
 > > cat /usr/src/sys/arch/i386/i386/genassym.cf  |  sh /usr/src/sys/kern/genassym.sh CC=/usr/src/../tools/bin/i386--netbsdelf-gcc /usr/src/../tools/bin/nbmkdep -f assym.dep --       -ffreestanding   -O2 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -fno-zero-initialized-in-bss  -Di386 -I.  -I/usr/src/sys/arch -I/usr/src/sys -nostdinc -DNMBCLUSTERS="65568" -DMAXFILES="4096" -DNOFILE="4096" -DLKM -DIPFILTER_LOOKUP -DMAXUSERS=16 -D_KERNEL -D_KERNEL_OPT -I/usr/src/sys/dist/ipf
 > > #   compile  CLARITY/if_ethersubr.o
 > > /usr/src/../tools/bin/i386--netbsdelf-gcc -ffreestanding -O2 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -fno-zero-initialized-in-bss -Di386 -I. -I/usr/src/sys/arch -I/usr/src/sys -nostdinc -DNMBCLUSTERS=65568 -DMAXFILES=4096 -DNOFILE=4096 -DLKM -DIPFILTER_LOOKUP -DMAXUSERS=16 -D_KERNEL -D_KERNEL_OPT -I/usr/src/sys/dist/ipf -c /usr/src/sys/net/if_ethersubr.c
 > > /usr/src/sys/net/if_ethersubr.c: In function `ether_input':
 > > /usr/src/sys/net/if_ethersubr.c:1034: warning: label `dropanyway' defined but not used
 > > 
 > > *** Failed target:  if_ethersubr.o
 > > 
 > > 
 > > >How-To-Repeat:
 > > Every time I try to compile my kernel (mostly a tuned i386 GENERIC with raid, ipf and ippool support) this crashes until I delete or comment out the offending line of unused label/unreachable code.
 > > >Fix:
 > > Delete or comment out line 1034 in sys/net/if_ethersubr.c per the compile error.
 > 
 > No, this label is used in some cases. I guess your kernel config file has
 > LLC without ISO nor NETATALK, can you confirm ?
 
 The attached patch should fix it, can you confirm ?
 
 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --
 
 --nFreZHaLTZJo0R7j
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=diff
 
 Index: if_ethersubr.c
 ===================================================================
 RCS file: /cvsroot/src/sys/net/if_ethersubr.c,v
 retrieving revision 1.120.2.1
 diff -u -p -u -r1.120.2.1 if_ethersubr.c
 --- if_ethersubr.c	2 Dec 2006 13:07:43 -0000	1.120.2.1
 +++ if_ethersubr.c	6 Jan 2007 14:44:58 -0000
 @@ -1031,7 +1031,9 @@ ether_input(struct ifnet *ifp, struct mb
  			break;
  		}
  #endif /* LLC */
 +#if defined (ISO) || defined (NETATALK)
  		dropanyway:
 +#endif
  		default:
  			m_freem(m);
  			return;
 
 --nFreZHaLTZJo0R7j--