From 47e7ed2f560c991959e4d3c09254e820ecd1fe25 Mon Sep 17 00:00:00 2001 From: acqn Date: Thu, 30 Nov 2023 00:36:13 +0800 Subject: [PATCH] Fixed wrong "Mixed declarations and code are not supported in cc65" error message when it should be "Expression expected". --- src/cc65/expr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc65/expr.c b/src/cc65/expr.c index 6d4b04892..54984230c 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -1412,9 +1412,9 @@ static void Primary (ExprDesc* E) } else { /* Let's see if this is a C99-style declaration */ DeclSpec Spec; - ParseDeclSpec (&Spec, TS_DEFAULT_TYPE_INT, SC_AUTO); + ParseDeclSpec (&Spec, TS_DEFAULT_TYPE_NONE, SC_AUTO); - if (Spec.Type->C != T_END) { + if ((Spec.Flags & DS_DEF_TYPE) == 0) { /* Recognized but not supported */ Error ("Mixed declarations and code are not supported in cc65");