diff options
author | Michael Forney <mforney@mforney.org> | 2021-09-07 00:13:26 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2021-09-07 00:13:41 -0700 |
commit | 056c471bb7f85854e2af7a0166785d06820b251a (patch) | |
tree | 44f51b488e7694816d9d71d4ecb42e543712a12b /qbe.c | |
parent | d589c20940e096dd23a6a8f30167d02a6c38631e (diff) |
qbe: Add default cases to avoid uninitialized warning
Diffstat (limited to 'qbe.c')
-rw-r--r-- | qbe.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) |