STAUTO bugfix to reinstate correct automatic variable storage allocation
authorNick Downing <downing.nick@gmail.com>
Fri, 10 Feb 2017 11:47:48 +0000 (22:47 +1100)
committerNick Downing <downing.nick@gmail.com>
Fri, 10 Feb 2017 11:56:52 +0000 (22:56 +1100)
c03.c
c1.h
ccom.c

diff --git a/c03.c b/c03.c
index cc173bb..933eb13 100644 (file)
--- 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 (file)
--- a/c1.h
+++ b/c1.h
@@ -8,7 +8,7 @@
 #include <setjmp.h>
 #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 (file)
--- 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