aboutsummaryrefslogtreecommitdiffhomepage
path: root/c
diff options
context:
space:
mode:
Diffstat (limited to 'c')
-rw-r--r--c/c.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/c/c.c b/c/c.c
index 4a461b9..63c3f7f 100644
--- a/c/c.c
+++ b/c/c.c
@@ -2174,7 +2174,9 @@ buildenum(struct comp *cm, internstr name, const struct span *span, int id)
}
td.backing = 0;
- for (int t = TYINT; t <= TYUVLONG; ++t) {
+ if (minv >= 0 && maxv <= ~0u) {
+ td.backing = TYUINT;
+ } else for (int t = TYINT; t <= TYUVLONG; ++t) {
inttyminmax(&tymin, &tymax, t);
if (minv >= tymin && maxv <= tymax) {
td.backing = t;