From 8e80542ecae0f3ca705d1a88ce6f638a03a7c6eb Mon Sep 17 00:00:00 2001 From: Nick Downing Date: Fri, 10 Feb 2017 22:47:48 +1100 Subject: [PATCH] STAUTO bugfix to reinstate correct automatic variable storage allocation --- c03.c | 2 ++ c1.h | 2 +- ccom.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/c03.c b/c03.c index cc173bb..933eb13 100644 --- a/c03.c +++ b/c03.c @@ -484,10 +484,12 @@ int decl1(askw, atptr, offset, absname) int askw; struct nmlist *atptr; int offs peeksym = a; if (skw==AUTO) { /* if (STAUTO < 0) { */ + /*fprintf(stderr, "%s autolen %d -> ", dsym->name, autolen);*/ autolen -= rlength((union tree *)dsym); dsym->hoffset = autolen; if (autolen < maxauto) maxauto = autolen; + /*fprintf(stderr, "%d maxauto %d\n", autolen, maxauto);*/ /* } else { */ /* dsym->hoffset = autolen; */ /* autolen += rlength(dsym); */ diff --git a/c1.h b/c1.h index ac75952..060406e 100644 --- a/c1.h +++ b/c1.h @@ -8,7 +8,7 @@ #include #include "ccom.h" -#define UNS(x) ((unsigned short)(x)) +#define UNS(x) ((_UNSIGNED_INT)(x)) struct optab { char tabdeg1; diff --git a/ccom.c b/ccom.c index 5e51b9d..215ca3c 100644 --- a/ccom.c +++ b/ccom.c @@ -33,6 +33,8 @@ int main(argc, argv) int argc; char **argv; { setbuf(temp_fp[0], buf1); setbuf(temp_fp[1], buf2); + STAUTO = -8; + /* * The hash table locations of the keywords * are marked; if an identifier hashes to one of -- 2.34.1