aboutsummaryrefslogtreecommitdiff
path: root/qbe.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-09-07 00:13:26 -0700
committerMichael Forney <mforney@mforney.org>2021-09-07 00:13:41 -0700
commit056c471bb7f85854e2af7a0166785d06820b251a (patch)
tree44f51b488e7694816d9d71d4ecb42e543712a12b /qbe.c
parentd589c20940e096dd23a6a8f30167d02a6c38631e (diff)
qbe: Add default cases to avoid uninitialized warning
Diffstat (limited to 'qbe.c')
-rw-r--r--qbe.c4
1 files changed, 3 insertions, 1 deletions
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)