Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6-1]: src/sys/netinet6 Pull up revision 1.84 via patch to fix gcc...



details:   https://anonhg.NetBSD.org/src/rev/eeb54bca6edd
branches:  netbsd-6-1
changeset: 775811:eeb54bca6edd
user:      jdc <jdc%NetBSD.org@localhost>
date:      Fri Jul 12 11:18:57 2013 +0000

description:
Pull up revision 1.84 via patch to fix gcc 4.1 compilation error
(uninitialised variable):

Some fun in trying to work out what was broken with gcc-4.1 to
trigger the following warning when gcc-4.5 was silent:
  nd6_rtr.c: In function 'nd6_ra_input':
  nd6_rtr.c:788: warning: 'ext' may be used uninitialized in this function
Eventually determined that it was not unreasonable for gcc-4.1 to
bleat in this case as there is a nasty 'goto insert' which could
indeed have resulted in an uninitialised variable use. Yay gcc 4.1.

diffstat:

 sys/netinet6/nd6_rtr.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r 76772f69e870 -r eeb54bca6edd sys/netinet6/nd6_rtr.c
--- a/sys/netinet6/nd6_rtr.c    Mon Jul 08 07:41:54 2013 +0000
+++ b/sys/netinet6/nd6_rtr.c    Fri Jul 12 11:18:57 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nd6_rtr.c,v 1.82.10.1 2013/07/08 07:40:56 jdc Exp $    */
+/*     $NetBSD: nd6_rtr.c,v 1.82.10.2 2013/07/12 11:18:57 jdc Exp $    */
 /*     $KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $        */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.82.10.1 2013/07/08 07:40:56 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_rtr.c,v 1.82.10.2 2013/07/12 11:18:57 jdc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -744,6 +744,7 @@
 defrtrlist_update(struct nd_defrouter *new)
 {
        struct nd_defrouter *dr, *n;
+       struct in6_ifextra *ext = new->ifp->if_afdata[AF_INET6];
        int s = splsoftnet();
 
        if ((dr = defrouter_lookup(&new->rtaddr, new->ifp)) != NULL) {
@@ -785,7 +786,6 @@
                return (dr);
        }
 
-       struct in6_ifextra *ext = new->ifp->if_afdata[AF_INET6];
        if (ip6_maxifdefrouters >= 0 &&
            ext->ndefrouters >= ip6_maxifdefrouters) {
                splx(s);



Home | Main Index | Thread Index | Old Index