diff options
| author | 2026-03-15 12:33:44 +0100 | |
|---|---|---|
| committer | 2026-03-15 12:34:02 +0100 | |
| commit | 1e98f81dca72530198e4c4fd01012d459bc28316 (patch) | |
| tree | 0ebb8eabff1f457a40fc1263fb975afc4b8d0f73 /c/c.c | |
| parent | b4caa5393f7a8ac5505c2892b85beb061196b78e (diff) | |
c: default enum to unsigned int backing type
Matches GCC behavior.
Diffstat (limited to 'c/c.c')
| -rw-r--r-- | c/c.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |