summaryrefslogtreecommitdiff
path: root/usr.bin/xlint
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-07-29 03:14:55 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-07-29 03:14:55 +0000
commit8a4544d7b07dbd04fec43fa76036c656a86e1c21 (patch)
treeb8491b2d410dfd29c417ad2266816f23e66bd3f3 /usr.bin/xlint
parent9e18e7c3eac6333749d0171464db0c5607336c9a (diff)
fix some initialization; ITOH Yasufumi <yasufu-i@is.aist-nara.ac.jp>
Diffstat (limited to 'usr.bin/xlint')
-rw-r--r--usr.bin/xlint/lint1/decl.c8
-rw-r--r--usr.bin/xlint/lint1/tree.c15
-rw-r--r--usr.bin/xlint/lint2/chk.c8
-rw-r--r--usr.bin/xlint/lint2/hash.c5
-rw-r--r--usr.bin/xlint/lint2/read.c5
5 files changed, 22 insertions, 19 deletions
diff --git a/usr.bin/xlint/lint1/decl.c b/usr.bin/xlint/lint1/decl.c
index 5524f95d53c..ef9c2f6434b 100644
--- a/usr.bin/xlint/lint1/decl.c
+++ b/usr.bin/xlint/lint1/decl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: decl.c,v 1.3 1998/07/27 16:53:39 deraadt Exp $ */
+/* $OpenBSD: decl.c,v 1.4 1998/07/29 03:14:48 millert Exp $ */
/* $NetBSD: decl.c,v 1.11 1995/10/02 17:34:16 jpo Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: decl.c,v 1.3 1998/07/27 16:53:39 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: decl.c,v 1.4 1998/07/29 03:14:48 millert Exp $";
#endif
#include <sys/param.h>
@@ -1427,7 +1427,7 @@ sym_t *
dname(sym)
sym_t *sym;
{
- scl_t sc;
+ scl_t sc = NOSCL;
if (sym->s_scl == NOSCL) {
dcs->d_rdcsym = NULL;
@@ -1557,7 +1557,7 @@ mktag(tag, kind, decl, semi)
tspec_t kind;
int decl, semi;
{
- scl_t scl;
+ scl_t scl = NOSCL;
type_t *tp;
if (kind == STRUCT) {
diff --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c
index 8f3ed920dfb..e9b3f3c475c 100644
--- a/usr.bin/xlint/lint1/tree.c
+++ b/usr.bin/xlint/lint1/tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tree.c,v 1.3 1998/07/27 16:53:41 deraadt Exp $ */
+/* $OpenBSD: tree.c,v 1.4 1998/07/29 03:14:50 millert Exp $ */
/* $NetBSD: tree.c,v 1.12 1995/10/02 17:37:57 jpo Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: tree.c,v 1.3 1998/07/27 16:53:41 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tree.c,v 1.4 1998/07/29 03:14:50 millert Exp $";
#endif
#include <stdlib.h>
@@ -769,7 +769,8 @@ typeok(op, arg, ln, rn)
tnode_t *ln, *rn;
{
mod_t *mp;
- tspec_t lt, rt, lst, rst, olt, ort;
+ tspec_t lt, rt = NOTSPEC, lst = NOTSPEC, rst = NOTSPEC,
+ olt = NOTSPEC, ort = NOTSPEC;
type_t *ltp, *rtp, *lstp, *rstp;
tnode_t *tn;
@@ -1194,7 +1195,7 @@ asgntypok(op, arg, ln, rn)
int arg;
tnode_t *ln, *rn;
{
- tspec_t lt, rt, lst, rst;
+ tspec_t lt, rt, lst = NOTSPEC, rst = NOTSPEC;
type_t *ltp, *rtp, *lstp, *rstp;
mod_t *mp;
const char *lts, *rts;
@@ -1647,7 +1648,7 @@ convert(op, arg, tp, tn)
tnode_t *tn;
{
tnode_t *ntn;
- tspec_t nt, ot, ost;
+ tspec_t nt, ot, ost = NOTSPEC;
if (tn->tn_lvalue)
lerror("convert() 1");
@@ -1889,7 +1890,7 @@ cvtcon(op, arg, tp, nv, v)
val_t *nv, *v;
{
tspec_t ot, nt;
- ldbl_t max, min;
+ ldbl_t max = 0, min = 0;
int sz, rchk;
quad_t xmask, xmsk1;
int osz, nsz;
@@ -3854,7 +3855,7 @@ precconf(tn)
tnode_t *tn;
{
tnode_t *ln, *rn;
- op_t lop, rop;
+ op_t lop, rop = NOOP;
int lparn, rparn;
mod_t *mp;
int warn;
diff --git a/usr.bin/xlint/lint2/chk.c b/usr.bin/xlint/lint2/chk.c
index 66a8cfd8ca8..9fa6acaee5f 100644
--- a/usr.bin/xlint/lint2/chk.c
+++ b/usr.bin/xlint/lint2/chk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chk.c,v 1.4 1998/07/27 16:53:43 deraadt Exp $ */
+/* $OpenBSD: chk.c,v 1.5 1998/07/29 03:14:51 millert Exp $ */
/* $NetBSD: chk.c,v 1.2 1995/07/03 21:24:42 cgd Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: chk.c,v 1.4 1998/07/27 16:53:43 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: chk.c,v 1.5 1998/07/29 03:14:51 millert Exp $";
#endif
#include <stdlib.h>
@@ -701,7 +701,7 @@ printflike(hte, call, n, fmt, ap)
const char *fp;
int fc;
int fwidth, prec, left, sign, space, alt, zero;
- tspec_t sz, t1, t2;
+ tspec_t sz, t1, t2 = NOTSPEC;
type_t *tp;
fp = fmt;
@@ -931,7 +931,7 @@ scanflike(hte, call, n, fmt, ap)
const char *fp;
int fc;
int noasgn, fwidth;
- tspec_t sz, t1, t2;
+ tspec_t sz, t1 = NOTSPEC, t2 = NOTSPEC;
type_t *tp;
fp = fmt;
diff --git a/usr.bin/xlint/lint2/hash.c b/usr.bin/xlint/lint2/hash.c
index 2122f4e5fa4..98d36a66f1f 100644
--- a/usr.bin/xlint/lint2/hash.c
+++ b/usr.bin/xlint/lint2/hash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hash.c,v 1.2 1996/06/26 05:44:23 deraadt Exp $ */
+/* $OpenBSD: hash.c,v 1.3 1998/07/29 03:14:52 millert Exp $ */
/* $NetBSD: hash.c,v 1.2 1995/07/03 21:24:47 cgd Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: hash.c,v 1.2 1996/06/26 05:44:23 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: hash.c,v 1.3 1998/07/29 03:14:52 millert Exp $";
#endif
#include <stddef.h>
@@ -97,6 +97,7 @@ hsearch(s, mknew)
/* create a new hte */
hte = xalloc(sizeof (hte_t));
+ memset(hte, 0, sizeof (hte_t));
hte->h_name = xstrdup(s);
hte->h_lsym = &hte->h_syms;
hte->h_lcall = &hte->h_calls;
diff --git a/usr.bin/xlint/lint2/read.c b/usr.bin/xlint/lint2/read.c
index 8c442892b30..826760213eb 100644
--- a/usr.bin/xlint/lint2/read.c
+++ b/usr.bin/xlint/lint2/read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read.c,v 1.2 1996/06/26 05:44:26 deraadt Exp $ */
+/* $OpenBSD: read.c,v 1.3 1998/07/29 03:14:54 millert Exp $ */
/* $NetBSD: read.c,v 1.2 1995/07/03 21:24:59 cgd Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: read.c,v 1.2 1996/06/26 05:44:26 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: read.c,v 1.3 1998/07/29 03:14:54 millert Exp $";
#endif
#include <stdio.h>
@@ -1070,6 +1070,7 @@ mkstatic(hte)
*/
for (nhte = hte; nhte->h_link != NULL; nhte = nhte->h_link) ;
nhte->h_link = xalloc(sizeof (hte_t));
+ memset(nhte->h_link, 0, sizeof (hte_t));
nhte = nhte->h_link;
nhte->h_name = hte->h_name;
nhte->h_static = 1;