bug fix in local extern-declarations, some other minor changes
authorceriel <none@none>
Mon, 1 Jun 1987 10:17:29 +0000 (10:17 +0000)
committerceriel <none@none>
Mon, 1 Jun 1987 10:17:29 +0000 (10:17 +0000)
lang/cem/cemcom/Makefile
lang/cem/cemcom/ch7bin.c
lang/cem/cemcom/idf.c
lang/cem/cemcom/ival.g

index 6579e9c..ad2bbf3 100644 (file)
@@ -23,16 +23,16 @@ ELIBS = $(INPLIB) $(EMMESLIB) $(EMELIB) $(PRTLIB) $(STRLIB) \
        $(ALLOCLIB) $(MALLOC) $(SYSLIB)
 LIB_INCLUDES = -I$(EMHOME)/modules/h -I$(EMHOME)/modules/pkg
 EM_INCLUDES = -I$(EMHOME)/h
-SYSLLIB = $(EMHOME)/modules/lib/llib-lsys.ln
+SYSLLIB = $(EMHOME)/modules/lib/llib-lsystem.ln
 EMKLLIB = $(EMHOME)/modules/lib/llib-lemk.ln
 EMELLIB = $(EMHOME)/modules/lib/llib-leme.ln
-STRLLIB = $(EMHOME)/modules/lib/llib-lstr.ln
+STRLLIB = $(EMHOME)/modules/lib/llib-lstring.ln
 PRTLLIB = $(EMHOME)/modules/lib/llib-lprint.ln
-EMMESLLIB = $(EMHOME)/modules/lib/llib-lmes.ln
+EMMESLLIB = $(EMHOME)/modules/lib/llib-lem_mes.ln
 INPLLIB = $(EMHOME)/modules/lib/llib-linput.ln
 ALLOCLLIB = $(EMHOME)/modules/lib/llib-lalloc.ln
-LINTLIBS =
-#LINTLIBS = $(EMMESLLIB) $(EMKLLIB) $(PRTLLIB) $(STRLLIB) $(SYSLLIB) $(ALLOCLLIB)
+#LINTLIBS =
+LINTLIBS = $(EMMESLLIB) $(EMKLLIB) $(PRTLLIB) $(STRLLIB) $(ALLOCLLIB) $(SYSLLIB)
 CURRDIR = .
 
 COPTIONS =
index cbd8a4b..d9a997f 100644 (file)
@@ -38,7 +38,6 @@ ch7bin(expp, oper, expr)
        any2opnd(expp, oper);
        any2opnd(&expr, oper);
        switch (oper)   {
-               int fund;
        case '[':                               /* RM 7.1 */
                /* RM 14.3 states that indexing follows the commutative laws */
                switch ((*expp)->ex_type->tp_fund)      {
@@ -102,7 +101,7 @@ ch7bin(expp, oper, expr)
        case '/':
        case DIVAB:
        case TIMESAB:
-               fund = arithbalance(expp, oper, &expr);
+               arithbalance(expp, oper, &expr);
                non_commutative_binop(expp, oper, expr);
                break;
        case '&':
@@ -112,7 +111,7 @@ ch7bin(expp, oper, expr)
                opnd2integral(&expr, oper);
                /* Fall through */
        case '*':
-               fund = arithbalance(expp, oper, &expr);
+               arithbalance(expp, oper, &expr);
                commutative_binop(expp, oper, expr);
                break;
        case '+':
@@ -132,7 +131,7 @@ ch7bin(expp, oper, expr)
                        pointer_binary(expp, oper, expr);
                }
                else    {
-                       fund = arithbalance(expp, oper, &expr);
+                       arithbalance(expp, oper, &expr);
                        if (oper == '+')
                                commutative_binop(expp, oper, expr);
                        else
@@ -152,7 +151,7 @@ ch7bin(expp, oper, expr)
                        }
                }
                else    {
-                       fund = arithbalance(expp, oper, &expr);
+                       arithbalance(expp, oper, &expr);
                        non_commutative_binop(expp, oper, expr);
                }
                break;
@@ -162,7 +161,7 @@ ch7bin(expp, oper, expr)
        case RIGHTAB:
                opnd2integral(expp, oper);
                opnd2integral(&expr, oper);
-               fund = arithbalance(expp, oper, &expr); /* ch. 7.5 */
+               arithbalance(expp, oper, &expr); /* ch. 7.5 */
                ch7cast(&expr, oper, int_type); /* cvt. rightop to int */
                non_commutative_binop(expp, oper, expr);
                break;
index fc0db65..c47c3ee 100644 (file)
@@ -263,7 +263,11 @@ declare_idf(ds, dc, lvl)
                        warning("redeclaring reserved word %s", idf->id_text);
        }
 #endif
-       if (def && def->df_level >= lvl)        {
+       if (def && 
+           ( def->df_level == lvl ||
+             ( lvl != L_GLOBAL && def->df_level > lvl )
+           )
+          )    {
                /*      There is already a declaration for idf on this
                        level, or even more inside.
                        The rules differ for different levels.
index c3bf24c..20b3da1 100644 (file)
@@ -337,9 +337,7 @@ check_and_pad(expp, tpp)
        struct type **tpp;
        struct expr **expp;
 {
-       /* ex is of a fundamental type  */
        register struct type *tp = *tpp;
-       register struct expr *ex = *expp;
 
        if (tp->tp_fund == ARRAY) {
                check_and_pad(expp, &(tp->tp_up));      /* first member */