cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit ec6ec4b1d04092e7175b658d5ea884e3f3b82c81
parent 38b1d570ac9f35af9b58e7ff33d61698b83384ff
Author: Michael Forney <mforney@mforney.org>
Date:   Fri,  5 Jun 2020 01:38:00 -0700

Help gcc see that variables are not used uninitialized

Diffstat:
Minit.c | 2++
Mpp.c | 3++-
Mtoken.c | 2+-
3 files changed, 5 insertions(+), 2 deletions(-)

diff --git 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 @@ -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 @@ -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;