aboutsummaryrefslogtreecommitdiff
path: root/type.h
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-02-18 12:34:25 -0800
committerMichael Forney <mforney@mforney.org>2019-02-18 12:48:38 -0800
commit9f964b728151066dd37dd80269ed23ea4b4cdeab (patch)
tree4dcde4880c175d6b2d1ef4903eaf6b746cda8836 /type.h
parent27e77f6ca6872c8d332c2e153773ca226d69fb64 (diff)
Fix compatible check for basic types
This check was only supposed to return true for enum types and their corresponding integer type. However, it had the side effect of making 'int' compatible with 'unsigned'. To fix this, introduce a new basic type kind for enums with the same rank as 'int', that is only compatible with itself and the 'int' type with the matching sign. Thanks to Andrew Chambers for the bug report.
Diffstat (limited to 'type.h')
-rw-r--r--type.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/type.h b/type.h
index d985a4a..0da444b 100644
--- a/type.h
+++ b/type.h
@@ -68,6 +68,7 @@ struct type {
BASICCHAR,
BASICSHORT,
BASICINT,
+ BASICENUM,
BASICLONG,
BASICLONGLONG,
BASICFLOAT,