From 5483cfe95e156118c01c35492c2d3a29ff5a2b15 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 9 Jul 2024 16:14:35 +0200 Subject: Allow negation of untyped integer constant --- src/analyzer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/analyzer.c b/src/analyzer.c index 6154029..4b15e0a 100644 --- a/src/analyzer.c +++ b/src/analyzer.c @@ -417,7 +417,7 @@ analyzeexpr(struct azctx *ctx, idx_t i) SET_DST_IF_SRC(ctx->cnst, i, rhs); type_t *t = ctx->types[rhs]; if (ctx->ast.kinds[i] == ASTUNNEG - && (t->kind != TYPE_NUM || !t->issigned)) + && (t->kind != TYPE_NUM || (!t->issigned && t->size != 0))) { err("analyzer: Unary negation is reserved for signed numeric " "types"); -- cgit v1.2.3