From 4489526a1138748cf5611cf19be6d125a6355124 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 9 Nov 1987 16:11:04 +0000 Subject: [PATCH] fixed some minor problems --- lang/m2/comp/Makefile | 2 +- lang/m2/comp/Parameters | 6 ++++++ lang/m2/comp/casestat.C | 1 - lang/m2/comp/chk_expr.c | 9 ++++++--- lang/m2/comp/code.c | 1 - lang/m2/comp/declar.g | 4 ++-- lang/m2/comp/desig.c | 1 - lang/m2/comp/error.c | 4 ++-- lang/m2/comp/options.c | 8 +++----- lang/m2/comp/type.c | 4 ++-- lang/m2/comp/walk.c | 1 - lang/m2/comp/walk.h | 2 ++ 12 files changed, 24 insertions(+), 19 deletions(-) diff --git a/lang/m2/comp/Makefile b/lang/m2/comp/Makefile index 663ccfb60..4c62d252f 100644 --- a/lang/m2/comp/Makefile +++ b/lang/m2/comp/Makefile @@ -39,7 +39,7 @@ OBJ = $(COBJ) $(LOBJ) Lpars.o GENH= errout.h\ idfsize.h numsize.h strsize.h target_sizes.h \ - inputtype.h density.h squeeze.h nocross.h \ + inputtype.h density.h squeeze.h nocross.h nostrict.h \ def.h debugcst.h type.h Lpars.h node.h desig.h strict3rd.h HFILES= LLlex.h\ chk_expr.h class.h const.h debug.h f_info.h idf.h\ diff --git a/lang/m2/comp/Parameters b/lang/m2/comp/Parameters index f1c9d5987..127248dbd 100644 --- a/lang/m2/comp/Parameters +++ b/lang/m2/comp/Parameters @@ -71,3 +71,9 @@ #undef NOCROSS 1 /* define when cross-compiler not needed */ +!File: nostrict.h +#undef NOSTRICT 1 /* define when STRICT warnings disabled + (yet another squeezing method) + */ + + diff --git a/lang/m2/comp/casestat.C b/lang/m2/comp/casestat.C index 40d7e249d..ec81d2570 100644 --- a/lang/m2/comp/casestat.C +++ b/lang/m2/comp/casestat.C @@ -24,7 +24,6 @@ #include #include -#include "squeeze.h" #include "Lpars.h" #include "type.h" #include "LLlex.h" diff --git a/lang/m2/comp/chk_expr.c b/lang/m2/comp/chk_expr.c index 853f3ad23..f21e48f4a 100644 --- a/lang/m2/comp/chk_expr.c +++ b/lang/m2/comp/chk_expr.c @@ -33,7 +33,7 @@ #include "misc.h" #include "warning.h" #include "main.h" -#include "squeeze.h" +#include "nostrict.h" extern char *symbol2str(); extern char *sprint(); @@ -658,7 +658,10 @@ ChkFunCall(expp) /* Check a call that must have a result */ - if (! ChkCall(expp)) return 0; + if (! ChkCall(expp)) { + expp->nd_type = error_type; + return 0; + } if (expp->nd_type == 0) { node_error(expp, "function call expected"); @@ -1176,7 +1179,7 @@ ChkStandard(expp) return 0; } if (! IsConformantArray(left->nd_type)) cstcall(expp, S_SIZE); -#ifndef SQUEEZE +#ifndef NOSTRICT else node_warning(expp, W_STRICT, "%s on conformant array", diff --git a/lang/m2/comp/code.c b/lang/m2/comp/code.c index 176715021..ec27c5170 100644 --- a/lang/m2/comp/code.c +++ b/lang/m2/comp/code.c @@ -21,7 +21,6 @@ #include #include -#include "squeeze.h" #include "type.h" #include "LLlex.h" #include "def.h" diff --git a/lang/m2/comp/declar.g b/lang/m2/comp/declar.g index 650f97586..aa5385148 100644 --- a/lang/m2/comp/declar.g +++ b/lang/m2/comp/declar.g @@ -28,7 +28,7 @@ #include "main.h" #include "chk_expr.h" #include "warning.h" -#include "squeeze.h" +#include "nostrict.h" int proclevel = 0; /* nesting level of procedures */ int return_occurred; /* set if a return occurs in a block */ @@ -74,7 +74,7 @@ ProcedureHeading(t_def **pdf; int type;) ]? ]? { CheckWithDef(*pdf, proc_type(tp, pr, parmaddr)); -#ifndef SQUEEZE +#ifndef NOSTRICT if (tp && IsConstructed(tp)) { warning(W_STRICT, "procedure \"%s\" has a constructed result type", (*pdf)->df_idf->id_text); diff --git a/lang/m2/comp/desig.c b/lang/m2/comp/desig.c index 87d5e923d..8aca3e461 100644 --- a/lang/m2/comp/desig.c +++ b/lang/m2/comp/desig.c @@ -24,7 +24,6 @@ #include #include -#include "squeeze.h" #include "type.h" #include "LLlex.h" #include "def.h" diff --git a/lang/m2/comp/error.c b/lang/m2/comp/error.c index 10bf8ca93..8ec53462c 100644 --- a/lang/m2/comp/error.c +++ b/lang/m2/comp/error.c @@ -28,7 +28,7 @@ #include "main.h" #include "node.h" #include "warning.h" -#include "squeeze.h" +#include "nostrict.h" /* error classes */ #define ERROR 1 @@ -177,7 +177,7 @@ _error(class, node, fmt, argv) remark = "(old-fashioned use)"; break; #endif -#ifndef SQUEEZE +#ifndef NOSTRICT case W_STRICT: remark = "(strict)"; break; diff --git a/lang/m2/comp/options.c b/lang/m2/comp/options.c index 329c0010c..4f5b742df 100644 --- a/lang/m2/comp/options.c +++ b/lang/m2/comp/options.c @@ -19,7 +19,7 @@ #include "type.h" #include "main.h" #include "warning.h" -#include "squeeze.h" +#include "nostrict.h" #include "nocross.h" #define MINIDFSIZE 14 @@ -47,9 +47,7 @@ DoOption(text) case 'n': /* no register messages */ case 'x': /* every name global */ case 's': /* symmetric: MIN(INTEGER) = -MAX(INTEGER) */ -#ifndef STRICT_3RD_ED case '3': /* strict 3rd edition Modula-2 */ -#endif options[text[-1]]++; break; @@ -62,7 +60,7 @@ DoOption(text) warning_classes &= ~W_OLDFASHIONED; break; #endif -#ifndef SQUEEZE +#ifndef NOSTRICT case 'R': warning_classes &= ~W_STRICT; break; @@ -85,7 +83,7 @@ DoOption(text) warning_classes |= W_OLDFASHIONED; break; #endif -#ifndef SQUEEZE +#ifndef NOSTRICT case 'R': warning_classes |= W_STRICT; break; diff --git a/lang/m2/comp/type.c b/lang/m2/comp/type.c index 20d927fa6..2ebf2bf64 100644 --- a/lang/m2/comp/type.c +++ b/lang/m2/comp/type.c @@ -17,7 +17,7 @@ #include #include -#include "squeeze.h" +#include "nostrict.h" #include "LLlex.h" #include "def.h" #include "type.h" @@ -475,7 +475,7 @@ set_type(tp) getbounds(tp, &lb, &ub); -#ifndef SQUEEZE +#ifndef NOSTRICT if (lb < 0) { warning(W_STRICT, "base type of set has negative lower bound"); } diff --git a/lang/m2/comp/walk.c b/lang/m2/comp/walk.c index f63ed28b2..d148ac991 100644 --- a/lang/m2/comp/walk.c +++ b/lang/m2/comp/walk.c @@ -24,7 +24,6 @@ #include #include "strict3rd.h" -#include "squeeze.h" #include "LLlex.h" #include "def.h" #include "type.h" diff --git a/lang/m2/comp/walk.h b/lang/m2/comp/walk.h index 2c9c9da8f..32e2b1b61 100644 --- a/lang/m2/comp/walk.h +++ b/lang/m2/comp/walk.h @@ -19,6 +19,8 @@ extern int (*WalkTable[])(); extern label text_label; extern label data_label; +#include "squeeze.h" + #ifndef SQUEEZE #define c_loc(x) C_loc((arith) (x)) #define c_lae_dlb(x) C_lae_dlb(x,(arith) 0) -- 2.34.1