From 21a689f9c8762fa7866f4aa7f2706b0c36c3b912 Mon Sep 17 00:00:00 2001 From: "Peter B. Kessler" Date: Wed, 29 Oct 1980 05:35:25 -0800 Subject: [PATCH] add warnings for extensions to language SCCS-vsn: usr.bin/pascal/src/fdec.c 1.7 SCCS-vsn: usr.bin/pascal/src/pcproc.c 1.3 SCCS-vsn: usr.bin/pascal/src/proc.c 1.3 SCCS-vsn: usr.bin/pascal/src/rval.c 1.5 SCCS-vsn: usr.bin/pascal/src/proc.c 1.3 SCCS-vsn: usr.bin/pascal/src/pcproc.c 1.3 --- usr/src/usr.bin/pascal/src/fdec.c | 5 +++-- usr/src/usr.bin/pascal/src/pcproc.c | 8 +++++--- usr/src/usr.bin/pascal/src/proc.c | 8 +++++--- usr/src/usr.bin/pascal/src/rval.c | 17 +++++++++++------ 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/usr/src/usr.bin/pascal/src/fdec.c b/usr/src/usr.bin/pascal/src/fdec.c index c79a1c0fb5..51ea6ecf98 100644 --- a/usr/src/usr.bin/pascal/src/fdec.c +++ b/usr/src/usr.bin/pascal/src/fdec.c @@ -1,6 +1,6 @@ /* Copyright (c) 1979 Regents of the University of California */ -static char sccsid[] = "@(#)fdec.c 1.6 %G%"; +static char sccsid[] = "@(#)fdec.c 1.7 %G%"; #include "whoami.h" #include "0.h" @@ -138,10 +138,11 @@ funchdr(r) case TREC: case TSET: case TSTR: + warning(); if (opt('s')) { standard(); - error("Functions should not return %ss", clnames[o]); } + error("Functions should not return %ss", clnames[o]); } # ifdef PC enclosing[ cbn ] = r[2]; diff --git a/usr/src/usr.bin/pascal/src/pcproc.c b/usr/src/usr.bin/pascal/src/pcproc.c index 43030198c6..0b6bd7d71a 100644 --- a/usr/src/usr.bin/pascal/src/pcproc.c +++ b/usr/src/usr.bin/pascal/src/pcproc.c @@ -1,6 +1,6 @@ /* Copyright (c) 1979 Regents of the University of California */ -static char sccsid[] = "@(#)pcproc.c 1.2 %G%"; +static char sccsid[] = "@(#)pcproc.c 1.3 %G%"; #include "whoami.h" #ifdef PC @@ -434,10 +434,11 @@ pcproc(r) fmt = 'c'; break; case TSCAL: + warning(); if (opt('s')) { standard(); - error("Writing scalars to text files is non-standard"); } + error("Writing scalars to text files is non-standard"); case TBOOL: fmt = 's'; break; @@ -1025,10 +1026,11 @@ pcproc(r) putleaf( P2ICON , 0 , 0 , P2PTR | P2CHAR , format ); putop( P2LISTOP , P2INT ); + warning(); if (opt('s')) { standard(); - error("Reading of enumerated types is non-standard"); } + error("Reading scalars from text files is non-standard"); } putop( P2CALL , readtype ); if ( isa( ap , "bcsi" ) ) { diff --git a/usr/src/usr.bin/pascal/src/proc.c b/usr/src/usr.bin/pascal/src/proc.c index 61180fe496..b521c391db 100644 --- a/usr/src/usr.bin/pascal/src/proc.c +++ b/usr/src/usr.bin/pascal/src/proc.c @@ -1,6 +1,6 @@ /* Copyright (c) 1979 Regents of the University of California */ -static char sccsid[] = "@(#)proc.c 1.2 %G%"; +static char sccsid[] = "@(#)proc.c 1.3 %G%"; #include "whoami.h" #ifdef OBJ @@ -364,10 +364,11 @@ proc(r) fmt = 'c'; break; case TSCAL: + warning(); if (opt('s')) { standard(); - error("Writing scalars to text files is non-standard"); } + error("Writing scalars to text files is non-standard"); case TBOOL: stkrval(alv, NIL , RREQ ); put(2, O_NAM, listnames(ap)); @@ -690,10 +691,11 @@ proc(r) put(1, op); else { put(2, op, listnames(ap)); + warning(); if (opt('s')) { standard(); - error("Reading of enumerated types is non-standard"); } + error("Reading scalars from text files is non-standard"); } /* * Data read is on the stack. diff --git a/usr/src/usr.bin/pascal/src/rval.c b/usr/src/usr.bin/pascal/src/rval.c index 05e67eaa33..66b1b8b6ca 100644 --- a/usr/src/usr.bin/pascal/src/rval.c +++ b/usr/src/usr.bin/pascal/src/rval.c @@ -1,6 +1,6 @@ /* Copyright (c) 1979 Regents of the University of California */ -static char sccsid[] = "@(#)rval.c 1.4 %G%"; +static char sccsid[] = "@(#)rval.c 1.5 %G%"; #include "whoami.h" #include "0.h" @@ -14,6 +14,9 @@ static char sccsid[] = "@(#)rval.c 1.4 %G%"; extern char *opnames[]; + /* line number of the last record comparison warning */ +short reccompline = 0; + #ifdef PC char *relts[] = { "_RELEQ" , "_RELNE" , @@ -737,9 +740,7 @@ cstrng: } contype = p; } - } else { - contype = p; - } + } /* * put out the width of the comparison. */ @@ -1016,8 +1017,12 @@ nocomp(c) switch (c) { case TREC: - if ( opt( 's' ) ) { - standard(); + if ( line != reccompline ) { + reccompline = line; + warning(); + if ( opt( 's' ) ) { + standard(); + } error("record comparison is non-standard"); } break; -- 2.20.1