Source-Changes-HG archive

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

[src/trunk]: src appease gcc -Wuninitialized



details:   https://anonhg.NetBSD.org/src/rev/2f79f8da6b44
branches:  trunk
changeset: 581533:2f79f8da6b44
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Jun 02 11:10:00 2005 +0000

description:
appease gcc -Wuninitialized

diffstat:

 dist/dhcp/client/clparse.c     |   6 ++++--
 dist/dhcp/client/dhclient.c    |   4 +++-
 dist/dhcp/common/conflex.c     |   5 ++++-
 dist/dhcp/common/execute.c     |   4 +++-
 dist/dhcp/common/packet.c      |   3 ++-
 dist/dhcp/common/tree.c        |   6 +++++-
 dist/dhcp/omapip/alloc.c       |   7 +++++++
 dist/dhcp/omapip/connection.c  |   2 ++
 dist/dhcp/omapip/dispatch.c    |   2 ++
 dist/dhcp/omapip/message.c     |   1 +
 dist/dhcp/relay/dhcrelay.c     |   4 ++--
 dist/dhcp/server/confpars.c    |   8 +++++++-
 dist/dhcp/server/failover.c    |  10 +++++++++-
 dist/dhcp/server/omapi.c       |   5 ++++-
 regress/sys/kern/lockf/lockf.c |   4 ++--
 15 files changed, 57 insertions(+), 14 deletions(-)

diffs (truncated from 337 to 300 lines):

diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/client/clparse.c
--- a/dist/dhcp/client/clparse.c        Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/client/clparse.c        Thu Jun 02 11:10:00 2005 +0000
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: clparse.c,v 1.8 2004/04/02 22:53:15 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: clparse.c,v 1.9 2005/06/02 11:10:00 lukem Exp $ Copyright (c) 1996-2001 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -639,7 +639,7 @@
        int ix, i;
        int token;
        const char *val;
-       pair p = (pair)0, q, r;
+       pair p = (pair)0, q = (pair)0, r;
 
        ix = 0;
        do {
@@ -771,6 +771,8 @@
        struct interface_info *ip = (struct interface_info *)0;
        isc_result_t status;
 
+       status = ISC_R_FAILURE;         /* XXXGCC -Wuninitialized */
+
        /* Find the interface (if any) that matches the name. */
        for (i = interfaces; i; i = i -> next) {
                if (!strcmp (i -> name, name)) {
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/client/dhclient.c
--- a/dist/dhcp/client/dhclient.c       Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/client/dhclient.c       Thu Jun 02 11:10:00 2005 +0000
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhclient.c,v 1.13 2004/05/06 09:07:54 itojun Exp $ Copyright (c) 1995-2002 Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhclient.c,v 1.14 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1995-2002 Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -3036,6 +3036,8 @@
        int result;
        isc_result_t rcode;
 
+       rcode = ISC_R_FAILURE;  /* XXXGCC -Wuninitialized */
+
        /* If we didn't send an FQDN option, we certainly aren't going to
           be doing an update. */
        if (!client -> sent_options)
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/common/conflex.c
--- a/dist/dhcp/common/conflex.c        Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/common/conflex.c        Thu Jun 02 11:10:00 2005 +0000
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: conflex.c,v 1.3 2004/10/29 21:19:32 dsl Exp $ Copyright (c) 1995-2001 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: conflex.c,v 1.4 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1995-2001 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -315,6 +315,9 @@
        int value;
        int hex;
 
+       value = 0;      /* XXXGCC -Wuninitialized */
+       hex = 0;        /* XXXGCC -Wuninitialized */
+                                       
        for (i = 0; i < sizeof cfile -> tokbuf; i++) {
              again:
                c = get_char (cfile);
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/common/execute.c
--- a/dist/dhcp/common/execute.c        Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/common/execute.c        Thu Jun 02 11:10:00 2005 +0000
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: execute.c,v 1.4 2003/02/18 17:08:41 drochner Exp $ Copyright (c) 1998-2002 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: execute.c,v 1.5 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1998-2002 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -659,6 +659,8 @@
        if (!statements)
                return;
 
+       col = 0;        /* XXXGCC -Wuninitialized */
+
        for (r = statements; r; r = r -> next) {
                switch (r -> op) {
                      case statements_statement:
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/common/packet.c
--- a/dist/dhcp/common/packet.c Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/common/packet.c Thu Jun 02 11:10:00 2005 +0000
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: packet.c,v 1.5 2004/10/22 05:22:39 perry Exp $ Copyright (c) 1996-2002 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: packet.c,v 1.6 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1996-2002 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -244,6 +244,7 @@
 
   ip = (struct ip *)(buf + bufix);
   udp = (struct udphdr *)(buf + bufix + ip_len);
+  len = 0;     /* XXXGCC -Wuninitialized */
 
 #ifdef USERLAND_FILTER
   /* Is it a UDP packet? */
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/common/tree.c
--- a/dist/dhcp/common/tree.c   Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/common/tree.c   Thu Jun 02 11:10:00 2005 +0000
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: tree.c,v 1.4 2003/02/18 17:08:41 drochner Exp $ Copyright (c) 1995-2002 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: tree.c,v 1.5 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1995-2002 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -657,6 +657,8 @@
        struct data_string name, data;
        int r0, r1, r2;
 
+       tname = NULL;   /* XXXGCC -Wuninitialized */
+
        if (!result || *result) {
                log_error ("evaluate_dns_expression called with non-null %s",
                           "result pointer");
@@ -1280,6 +1282,8 @@
        struct binding *binding;
        struct binding_value *bv;
 
+       status = 0;     /* XXXGCC -Wuninitialized */
+
        switch (expr -> op) {
                /* Extract N bytes starting at byte M of a data string. */
              case expr_substring:
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/omapip/alloc.c
--- a/dist/dhcp/omapip/alloc.c  Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/omapip/alloc.c  Thu Jun 02 11:10:00 2005 +0000
@@ -517,6 +517,8 @@
        omapi_object_t *foo;
        isc_result_t status;
 
+       tsize = 0;      /* XXXGCC -Wuninitialized */
+
        if (type -> allocator) {
                foo = (omapi_object_t *)0;
                status = (*type -> allocator) (&foo, file, line);
@@ -801,6 +803,11 @@
 
        va_start (l, type);
 
+       val = 0;        /* XXXGCC -Wuninitialized */
+       intval = 0;     /* XXXGCC -Wuninitialized */
+       s = NULL;       /* XXXGCC -Wuninitialized */
+       obj = NULL;     /* XXXGCC -Wuninitialized */
+
        switch (type) {
              case omapi_datatype_int:
                len = OMAPI_TYPED_DATA_INT_LEN;
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/omapip/connection.c
--- a/dist/dhcp/omapip/connection.c     Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/omapip/connection.c     Thu Jun 02 11:10:00 2005 +0000
@@ -714,6 +714,8 @@
        char *name_str = NULL;
        isc_result_t status = ISC_R_SUCCESS;
 
+       algorithm_id = 0;       /* XXXGCC -Wuninitialized */
+
        if (status == ISC_R_SUCCESS)
                status = omapi_get_value_str
                        (a, (omapi_object_t *)0, "name", &name);
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/omapip/dispatch.c
--- a/dist/dhcp/omapip/dispatch.c       Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/omapip/dispatch.c       Thu Jun 02 11:10:00 2005 +0000
@@ -224,6 +224,8 @@
        omapi_waiter_object_t *waiter;
        omapi_object_t *tmp = (omapi_object_t *)0;
 
+       status = ISC_R_FAILURE;         /* XXXGCC -Wuninitialized */
+
        if (!wo || wo -> type != omapi_type_waiter)
                waiter = (omapi_waiter_object_t *)0;
        else
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/omapip/message.c
--- a/dist/dhcp/omapip/message.c        Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/omapip/message.c        Thu Jun 02 11:10:00 2005 +0000
@@ -660,6 +660,7 @@
              case OMAPI_OP_UPDATE:
                if (m && m -> object) {
                        omapi_object_reference (&object, m -> object, MDL);
+                       status = 0;     /* XXXGCC -Wuninitialized */
                } else {
                        status = omapi_handle_lookup (&object, message -> h);
                        if (status != ISC_R_SUCCESS) {
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/relay/dhcrelay.c
--- a/dist/dhcp/relay/dhcrelay.c        Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/relay/dhcrelay.c        Thu Jun 02 11:10:00 2005 +0000
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhcrelay.c,v 1.5 2003/02/18 17:08:43 drochner Exp $ Copyright (c) 1997-2002 Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhcrelay.c,v 1.6 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1997-2002 Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -647,7 +647,7 @@
 {
        int i = 0;
        u_int8_t *circuit_id = 0;
-       unsigned circuit_id_len;
+       unsigned circuit_id_len = 0;
        struct interface_info *ip;
 
        while (i < len) {
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/server/confpars.c
--- a/dist/dhcp/server/confpars.c       Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/server/confpars.c       Thu Jun 02 11:10:00 2005 +0000
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: confpars.c,v 1.6 2005/06/02 05:45:59 lukem Exp $ Copyright (c) 1995-2003 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: confpars.c,v 1.7 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1995-2003 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -1810,6 +1810,8 @@
        int new = 1;
        isc_result_t status;
 
+       status = ISC_R_FAILURE; /* XXXGCC -Wuninitialized */
+
        token = next_token (&val, (unsigned *)0, cfile);
        if (token != STRING) {
                parse_warn (cfile, "Expecting class name");
@@ -2520,6 +2522,10 @@
        unsigned buflen = 0;
        struct class *class;
 
+       seenbit = 0;    /* XXXGCC -Wuninitialized */
+       newbinding = 0; /* XXXGCC -Wuninitialized */
+       new_state = 0;  /* XXXGCC -Wuninitialized */
+
        lease = (struct lease *)0;
        status = lease_allocate (&lease, MDL);
        if (status != ISC_R_SUCCESS)
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/server/failover.c
--- a/dist/dhcp/server/failover.c       Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/server/failover.c       Thu Jun 02 11:10:00 2005 +0000
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: failover.c,v 1.7 2002/06/11 15:22:59 wiz Exp $ Copyright (c) 1999-2001 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: failover.c,v 1.8 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1999-2001 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -3424,6 +3424,10 @@
        char tbuf [256];
 #endif
 
+       size = 0;       /* XXXGCC -Wuninitialized */
+       ilen = 0;       /* XXXGCC -Wuninitialized */
+       txt = NULL;     /* XXXGCC -Wuninitialized */
+
        /* Note that the failover_option structure is used differently on
           input than on output - on input, count is an element count, and
           on output it's the number of bytes total in the option, including
@@ -4945,6 +4949,8 @@
 {
        binding_state_t new_state;
 
+       new_state = 0;  /* XXXGCC -Wuninitialized */
+
        /* If there is no transition, it's no problem. */
        if (binding_state == lease -> binding_state)
                return binding_state;
@@ -5108,6 +5114,8 @@
 {
        binding_state_t new_state;
 
+       new_state = 0;  /* XXXGCC -Wuninitialized */
+
        /* If there is no transition, it's no problem. */
        if (binding_state == lease -> binding_state)
                new_state = binding_state;
diff -r d22b120287e8 -r 2f79f8da6b44 dist/dhcp/server/omapi.c
--- a/dist/dhcp/server/omapi.c  Thu Jun 02 11:09:02 2005 +0000
+++ b/dist/dhcp/server/omapi.c  Thu Jun 02 11:10:00 2005 +0000



Home | Main Index | Thread Index | Old Index