From 1fb8da7a0286e2d04fe7b1663b29b94f25516624 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 1 Jun 1987 10:17:29 +0000 Subject: [PATCH] bug fix in local extern-declarations, some other minor changes --- lang/cem/cemcom/Makefile | 10 +++++----- lang/cem/cemcom/ch7bin.c | 11 +++++------ lang/cem/cemcom/idf.c | 6 +++++- lang/cem/cemcom/ival.g | 2 -- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lang/cem/cemcom/Makefile b/lang/cem/cemcom/Makefile index 6579e9c03..ad2bbf3e1 100644 --- a/lang/cem/cemcom/Makefile +++ b/lang/cem/cemcom/Makefile @@ -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 = diff --git a/lang/cem/cemcom/ch7bin.c b/lang/cem/cemcom/ch7bin.c index cbd8a4b44..d9a997fb2 100644 --- a/lang/cem/cemcom/ch7bin.c +++ b/lang/cem/cemcom/ch7bin.c @@ -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; diff --git a/lang/cem/cemcom/idf.c b/lang/cem/cemcom/idf.c index fc0db651b..c47c3eeed 100644 --- a/lang/cem/cemcom/idf.c +++ b/lang/cem/cemcom/idf.c @@ -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. diff --git a/lang/cem/cemcom/ival.g b/lang/cem/cemcom/ival.g index c3bf24cf6..20b3da180 100644 --- a/lang/cem/cemcom/ival.g +++ b/lang/cem/cemcom/ival.g @@ -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 */ -- 2.34.1