From 056c471bb7f85854e2af7a0166785d06820b251a Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 7 Sep 2021 00:13:26 -0700 Subject: qbe: Add default cases to avoid uninitialized warning --- qbe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qbe.c b/qbe.c index be7dce7..e3c7148 100644 --- a/qbe.c +++ b/qbe.c @@ -482,12 +482,14 @@ convert(struct func *f, struct type *dst, struct type *src, struct value *l) case 2: op = ICNEW, l = funcinst(f, IEXTUH, 'w', l, NULL); break; case 4: op = ICNEW; break; case 8: op = ICNEL; break; + default: fatal("internal error; unknown integer conversion"); } } else { assert(src->prop & PROPFLOAT); switch (src->size) { case 4: op = ICNES, r = mkfltconst(VALUE_FLTCONST, 0); break; case 8: op = ICNED, r = mkfltconst(VALUE_DBLCONST, 0); break; + default: fatal("internal error; unknown floating point conversion"); } } } else if (dst->prop & PROPINT) { @@ -499,7 +501,7 @@ convert(struct func *f, struct type *dst, struct type *src, struct value *l) case 4: op = src->basic.issigned ? IEXTSW : IEXTUW; break; case 2: op = src->basic.issigned ? IEXTSH : IEXTUH; break; case 1: op = src->basic.issigned ? IEXTSB : IEXTUB; break; - default: fatal("internal error; unknown int conversion"); + default: fatal("internal error; unknown integer conversion"); } } else { if (!dst->basic.issigned) -- cgit v1.2.3