From ec6ec4b1d04092e7175b658d5ea884e3f3b82c81 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 5 Jun 2020 01:38:00 -0700 Subject: Help gcc see that variables are not used uninitialized --- init.c | 2 ++ pp.c | 3 ++- token.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/init.c b/init.c index f9346fa..0e890c0 100644 --- a/init.c +++ b/init.c @@ -163,6 +163,8 @@ focus(struct initparser *p) p->sub->mem = p->sub->type->structunion.members; t = p->sub->mem->type; break; + default: + fatal("internal error: init cursor has unexpected type"); } subobj(p, t, 0); } diff --git a/pp.c b/pp.c index 5b9258b..d3f9915 100644 --- a/pp.c +++ b/pp.c @@ -220,8 +220,9 @@ define(void) if (t->kind == TLPAREN && !t->space) { m->kind = MACROFUNC; /* read macro parameter names */ + p = NULL; while (scan(&tok), tok.kind != TRPAREN) { - if (params.len) { + if (p) { if (p->flags & PARAMVAR) tokencheck(&tok, TRPAREN, "after '...'"); tokencheck(&tok, TCOMMA, "or ')' after macro parameter"); diff --git a/token.c b/token.c index 0fe306f..ae31ac4 100644 --- a/token.c +++ b/token.c @@ -143,7 +143,7 @@ static void tokendesc(char *buf, size_t len, enum tokenkind kind, const char *lit) { const char *class; - bool quote; + bool quote = true; switch (kind) { case TEOF: class = "EOF"; break; -- cgit v1.2.3