# 2.11BSD#431 - /usr/src/usr.bin/f77/error.c

##### Functions

    error             X

##### Variables

    efil              X
    efilname          X

       1: #include "defs"
       2: #include "string_defs"
       3:
       4: #ifdef  C_OVERLAY
       5: char efilname[] = "/usr/share/misc/f77_strings";
       6: int  efil = -1;
       7:
       8: error(index,t,u,type)
       9: unsigned index;
      10: char *t, *u;
      11: register int type;
      12: {
      13:     char buf[100];
      14:     long lseek();
      15:
      16:     if (efil < 0) {
      17:         efil = open(efilname, 0);
      18:         if (efil < 0) {
      19: oops:
      20:             perror(efilname);
      21:             exit(1);
      22:         }
      23:     }
      24:     if (lseek(efil, (long) index, 0) < 0 || read(efil, buf, sizeof(buf)) <= 0)
      25:         goto oops;
      26:     switch (type) {
      27:         case WARN1:
      28:         case WARN:
      29:         if(nowarnflag)
      30:             return;
      31:         fprintf(diagfile, "Warning on line %d of %s: ", lineno, infname);
      32:         ++nwarn;
      33:         break;
      34:
      35:         case YYERR:
      36:         case ERR2:
      37:         case ERR1:
      38:         case ERR:
      39:         fprintf(diagfile, "Error on line %d of %s: ", lineno, infname);
      40:         ++nerr;
      41:         break;
      42:
      43:         case FATAL1:
      44:         case FATAL:
      45:         if (buf[0] != '\0') {
      46:             fprintf(diagfile, buf, t, u);
      47:             fprintf(diagfile, "\n");
      48:         }
      49:         fprintf(diagfile,"f77 compiler error line %d of %s: ", lineno, infname);
      50:         fprintf(diagfile,buf,t,u);
      51:         fputc('\n',diagfile);
      52:         if(debugflag)
      53:             abort();
      54:         done(3);
      55:         exit(3);
      56:         case EXECERR:
      57:         fprintf(diagfile, "Error on line %d of %s: ", lineno, infname);
      58:         fprintf(diagfile,"Execution error %s");
      59:         ++nerr;
      60:         break;
      61:         case DCLERR:
      62:         if(t)
      63:             fprintf(diagfile,"Declaration error for %s: %s\n",
      64:             varstr(VL, (struct nameblock *)t->varname), buf);
      65:         else
      66:             fprintf(diagfile,"Declaration error %s\n", buf);
      67:         return;
      68:
      69:         default:
      70:         fprintf(diagfile,"unrecognizable error switch\n");
      71:         exit(1);
      72:         /*NOTREACHED*/
      73:     }
      74:     fprintf(diagfile,buf,t,u);
      75:     fprintf(diagfile,"\n");
      76: }
      77:
      78: #else   C_OVERLAY
      79:
      80: error(str,t,u,type)
      81: char *str, *t, *u;
      82: register int type;
      83: {
      84:     switch (type) {
      85:         case WARN1:
      86:         case WARN:
      87:         if(nowarnflag)
      88:             return;
      89:         fprintf(diagfile, "Warning on line %d of %s: ", lineno, infname);
      90:         ++nwarn;
      91:         break;
      92:
      93:         case YYERR:
      94:         case ERR2:
      95:         case ERR1:
      96:         case ERR:
      97:         fprintf(diagfile, "Error on line %d of %s: ", lineno, infname);
      98:         ++nerr;
      99:         break;
     100:
     101:         case FATAL1:
     102:         case FATAL:
     103:         if (str != NULL) {
     104:             fprintf(diagfile, str, t, u);
     105:             fprintf(diagfile, "\n");
     106:         }
     107:         fprintf(diagfile,"f77 compiler error line %d of %s: ", lineno, infname);
     108:         if(debugflag)
     109:             abort();
     110:         done(3);
     111:         exit(3);
     112:         case EXECERR:
     113:         fprintf(diagfile, "Error on line %d of %s: ", lineno, infname);
     114:         fprintf(diagfile, "Execution error %s");
     115:         ++nerr;
     116:         break;
     117:         case DCLERR:
     118:         if(t)
     119:             fprintf(diagfile,"Declaration error for %s: %s\n",
     120:             varstr(VL, (struct nameblock *)t->varname), str);
     121:         else
     122:             fprintf(diagfile,"Declaration error %s\n", str);
     123:         return;
     124:
     125:         default:
     126:         fprintf(diagfile,"unrecognizable error switch\n");
     127:         exit(1);
     128:         /*NOTREACHED*/
     129:     }
     130:     fprintf(diagfile,str,t,u);
     131:     fprintf(diagfile,"\n");
     132: }
     133:
     134: #endif	C_OVERLAY

#### Defined functions

error defined in line 80; used 216 times

- in /usr/src/usr.bin/f77/data.c line 23, 31, 41, 75, 145, 158, 176, 223, 230, 288
- in /usr/src/usr.bin/f77/equiv.c line 39, 52, 58, 78, 98, 125, 152, 186-191(2)
- in /usr/src/usr.bin/f77/exec.c line 31, 49, 69, 80, 91, 138, 145, 172, 184, 224, 243, 283, 291, 312, 322-326(2), 348, 370, 478, 498, 530-533(2), 555
- in /usr/src/usr.bin/f77/expr.c line 126, 158, 273, 332, 363, 396, 402, 518, 567, 714, 720-723(2), 749-759(3), 816, 826, 910, 1024, 1031-1033(2), 1111, 1163, 1198, 1236, 1255, 1287, 1353, 1506, 1559-1569(3), 1577, 1588, 1594-1598(2), 1604, 1628, 1648, 1694, 1863, 1891, 1900, 2014, 2076, 2097, 2131, 2197
- in /usr/src/usr.bin/f77/gram.dcl line 54, 98, 135, 172, 187, 205, 263, 299, 315
- in /usr/src/usr.bin/f77/gram.exec line 5, 46, 73
- in /usr/src/usr.bin/f77/gram.head line 62, 71-72(2), 85-90(2), 115
- in /usr/src/usr.bin/f77/init.c line 241
- in /usr/src/usr.bin/f77/intr.c line 502-510(3), 555, 577-581(2)
- in /usr/src/usr.bin/f77/io.c line 183, 193, 257, 263-268(2), 347, 369-371(2), 389, 401, 417, 464, 483, 590, 610, 620, 653, 662-664(2), 685-690(2), 698, 722, 732-736(2), 769, 798, 813
- in /usr/src/usr.bin/f77/lex.c line 115, 220, 244, 358, 389, 441, 492, 725, 741, 748
- in /usr/src/usr.bin/f77/main.c line 49, 84-89(2), 96, 116, 156, 176
- in /usr/src/usr.bin/f77/misc.c line 244, 283, 306, 347, 378, 498, 603
- in /usr/src/usr.bin/f77/pdp11.c line 254
- in /usr/src/usr.bin/f77/proc.c line 10, 29-32(2), 104-105(2), 242, 312-317(3), 404, 422-424(2), 492, 504, 525, 560, 596, 602, 649, 662, 691, 699, 750-754(2), 772, 778-782(2), 793-798(2), 819, 837
- in /usr/src/usr.bin/f77/put.c line 141, 264
- in /usr/src/usr.bin/f77/putdmr.c line 84, 116, 172, 333, 342, 431, 464, 498, 633, 734, 803-813(3), 1025, 1079

#### Defined variables

efil defined in line 6; used 5 times

- in line 16-18(3), 24(2)

efilname defined in line 5; used 2 times

- in line 17-20(2)

Last modified: 1996-10-26 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 604 |