diff options
author | Michael Forney <mforney@mforney.org> | 2024-04-02 14:11:04 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2024-04-03 00:01:03 -0700 |
commit | 443c328a675a0798640436d9a379ae36d4c1cfc0 (patch) | |
tree | 83ac7130d1a9cd2acea1c663726c3d92b5431df1 | |
parent | be3fc1c2dc8352fdb1a0ee9385a3bcc06875b55c (diff) |
expr: Help gcc see that variables aren't used uninitialized
-rw-r--r-- | expr.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -540,6 +540,7 @@ stringconcat(struct stringlit *str, bool forceutf8) case 'u': t = &typeushort; break; case 'U': t = &typeuint; break; case 'L': t = targ->typewchar; break; + default: assert(0); } switch (t->size) { case 1: @@ -554,6 +555,8 @@ stringconcat(struct stringlit *str, bool forceutf8) width = sizeof(uint_least32_t); encodechar = encodechar32; break; + default: + assert(0); } buf = xreallocarray(NULL, len, width); str->data = buf; @@ -1238,6 +1241,7 @@ condexpr(struct scope *s) t = mkpointertype(t, tq); } else { error(&tok.loc, "invalid operands to conditional operator"); + return NULL; /* unreachable */ } } e = eval(e); |