add warnings for extensions to language
authorPeter B. Kessler <peter@ucbvax.Berkeley.EDU>
Wed, 29 Oct 1980 13:35:25 +0000 (05:35 -0800)
committerPeter B. Kessler <peter@ucbvax.Berkeley.EDU>
Wed, 29 Oct 1980 13:35:25 +0000 (05:35 -0800)
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
usr/src/usr.bin/pascal/src/pcproc.c
usr/src/usr.bin/pascal/src/proc.c
usr/src/usr.bin/pascal/src/rval.c

index c79a1c0..51ea6ec 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* 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"
 
 #include "whoami.h"
 #include "0.h"
@@ -138,10 +138,11 @@ funchdr(r)
                            case TREC:
                            case TSET:
                            case TSTR:
                            case TREC:
                            case TSET:
                            case TSTR:
+                                   warning();
                                    if (opt('s')) {
                                            standard();
                                    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];
                    }
 #                  ifdef PC
                        enclosing[ cbn ] = r[2];
index 4303019..0b6bd7d 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* 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
 
 #include "whoami.h"
 #ifdef PC
@@ -434,10 +434,11 @@ pcproc(r)
                                fmt = 'c';
                                break;
                        case TSCAL:
                                fmt = 'c';
                                break;
                        case TSCAL:
+                               warning();
                                if (opt('s')) {
                                        standard();
                                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;
                        case TBOOL:
                                fmt = 's';
                                break;
@@ -1025,10 +1026,11 @@ pcproc(r)
                                putleaf( P2ICON , 0 , 0 , P2PTR | P2CHAR
                                        , format );
                                putop( P2LISTOP , P2INT );
                                putleaf( P2ICON , 0 , 0 , P2PTR | P2CHAR
                                        , format );
                                putop( P2LISTOP , P2INT );
+                               warning();
                                if (opt('s')) {
                                        standard();
                                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" ) ) {
                        }
                        putop( P2CALL , readtype );
                        if ( isa( ap , "bcsi" ) ) {
index 61180fe..b521c39 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* 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
 
 #include "whoami.h"
 #ifdef OBJ
@@ -364,10 +364,11 @@ proc(r)
                                fmt = 'c';
                                break;
                        case TSCAL:
                                fmt = 'c';
                                break;
                        case TSCAL:
+                               warning();
                                if (opt('s')) {
                                        standard();
                                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));
                        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));
                                put(1, op);
                        else {
                                put(2, op, listnames(ap));
+                               warning();
                                if (opt('s')) {
                                        standard();
                                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.
                        }
                        /*
                         * Data read is on the stack.
index 05e67ea..66b1b8b 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* 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"
 
 #include "whoami.h"
 #include "0.h"
@@ -14,6 +14,9 @@ static        char sccsid[] = "@(#)rval.c 1.4 %G%";
 
 extern char *opnames[];
 
 
 extern char *opnames[];
 
+    /* line number of the last record comparison warning */
+short reccompline = 0;
+
 #ifdef PC
     char       *relts[] =  {
                                "_RELEQ" , "_RELNE" ,
 #ifdef PC
     char       *relts[] =  {
                                "_RELEQ" , "_RELNE" ,
@@ -737,9 +740,7 @@ cstrng:
                                }
                                contype = p;
                            }
                                }
                                contype = p;
                            }
-                       } else {
-                           contype = p;
-                       }
+                       } 
                            /*
                             *  put out the width of the comparison.
                             */
                            /*
                             *  put out the width of the comparison.
                             */
@@ -1016,8 +1017,12 @@ nocomp(c)
 
        switch (c) {
                case TREC:
 
        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;
                            error("record comparison is non-standard");
                        }
                        break;