summaryrefslogtreecommitdiffstats
path: root/gc.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-02-22 06:51:52 -0800
committerKaz Kylheku <kaz@kylheku.com>2022-02-22 06:51:52 -0800
commitc38dbf7975d0df4758b295b90a47c1dbaaeaa976 (patch)
treee78af52c4971974ba157469e7d656e6f1ff71d94 /gc.h
parentde1cce6d446c38fde590cac2531560742d446043 (diff)
downloadtxr-c38dbf7975d0df4758b295b90a47c1dbaaeaa976.tar.gz
txr-c38dbf7975d0df4758b295b90a47c1dbaaeaa976.tar.bz2
txr-c38dbf7975d0df4758b295b90a47c1dbaaeaa976.zip
gc: c++ fix in type_t conversion.
* gc.c (sweep_one): The recent fix to address the clang diagnostic from -fsanitize=implicit-conversion broke C++ compatibility, due to enums being type safe. We revert the expression to the original, before that fix, and address the clang diagnostic differently. * gc.h (REACHABLE, FREE): Add a U suffix to the constants to make them unsigned. The implicit conversion issue in the expression convert(type_t, block->t.type & ~REACHABLE) is that ~REACHABLE is -257, and is being converted to unsigned.
Diffstat (limited to 'gc.h')
-rw-r--r--gc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gc.h b/gc.h
index 6103781a..a575ec88 100644
--- a/gc.h
+++ b/gc.h
@@ -66,8 +66,8 @@ extern val break_obj;
#endif
#define gc_hint(var) gc_hint_func(&var)
-#define REACHABLE 0x100
-#define FREE 0x200
+#define REACHABLE 0x100U
+#define FREE 0x200U
INLINE val zap(volatile val *loc) { val ret = *loc; *loc = nil; return ret; }