|
|
1.1 root 1:
2: #include "defs.h"
3:
4:
5: warn1(s,t)
6: char *s, *t;
7: {
8: char buff[100];
9: sprintf(buff, s, t);
10: warn(buff);
11: }
12:
13:
14: warn(s)
15: char *s;
16: {
17: if(nowarnflag)
18: return;
19: fprintf(diagfile, "Warning on line %d of %s: %s\n", lineno, infname, s);
20: ++nwarn;
21: }
22:
23:
24: errstr(s, t)
25: char *s, *t;
26: {
27: char buff[100];
28: sprintf(buff, s, t);
29: err(buff);
30: }
31:
32:
33: errnm(fmt, l, s)
34: char *fmt;
35: int l;
36: register char *s;
37: {
38: char buff[VL+1];
39: register int i;
40:
41: i = 0;
42: while (i < l)
43: {
44: buff[i] = s[i];
45: i++;
46: }
47: buff[i] = '\0';
48:
49: errstr(fmt, buff);
50: }
51:
52: warnnm(fmt, l, s)
53: char *fmt;
54: int l;
55: register char *s;
56: {
57: char buff[VL+1];
58: register int i;
59:
60: i = 0;
61: while (i < l)
62: {
63: buff[i] = s[i];
64: i++;
65: }
66: buff[i] = '\0';
67:
68: warn1(fmt, buff);
69: }
70:
71: erri(s,t)
72: char *s;
73: int t;
74: {
75: char buff[100];
76: sprintf(buff, s, t);
77: err(buff);
78: }
79:
80:
81: err(s)
82: char *s;
83: {
84: fprintf(diagfile, "Error on line %d of %s: %s\n", lineno, infname, s);
85: ++nerr;
86: optoff();
87: }
88:
89:
90: yyerror(s)
91: char *s;
92: { err(s); }
93:
94:
95:
96: dclerr(s, v)
97: char *s;
98: Namep v;
99: {
100: char buff[100];
101:
102: if(v)
103: {
104: sprintf(buff, "Declaration error for %s: %s", varstr(VL, v->varname), s);
105: err(buff);
106: }
107: else
108: errstr("Declaration error %s", s);
109: }
110:
111:
112:
113: execerr(s, n)
114: char *s, *n;
115: {
116: char buf1[100], buf2[100];
117:
118: sprintf(buf1, "Execution error %s", s);
119: sprintf(buf2, buf1, n);
120: err(buf2);
121: }
122:
123:
124: fatal(t)
125: char *t;
126: {
127: fprintf(diagfile, "Compiler error line %d of %s: %s\n", lineno, infname, t);
128: if (debugflag[8])
129: showbuffer();
130: if (debugflag[0])
131: abort();
132: done(3);
133: exit(3);
134: }
135:
136:
137:
138:
139: fatalstr(t,s)
140: char *t, *s;
141: {
142: char buff[100];
143: sprintf(buff, t, s);
144: fatal(buff);
145: }
146:
147:
148:
149: fatali(t,d)
150: char *t;
151: int d;
152: {
153: char buff[100];
154: sprintf(buff, t, d);
155: fatal(buff);
156: }
157:
158:
159:
160: badthing(thing, r, t)
161: char *thing, *r;
162: int t;
163: {
164: char buff[50];
165: sprintf(buff, "Impossible %s %d in routine %s", thing, t, r);
166: fatal(buff);
167: }
168:
169:
170:
171: badop(r, t)
172: char *r;
173: int t;
174: {
175: badthing("opcode", r, t);
176: }
177:
178:
179:
180: badtag(r, t)
181: char *r;
182: int t;
183: {
184: badthing("tag", r, t);
185: }
186:
187:
188:
189:
190:
191: badstg(r, t)
192: char *r;
193: int t;
194: {
195: badthing("storage class", r, t);
196: }
197:
198:
199:
200:
201: badtype(r, t)
202: char *r;
203: int t;
204: {
205: badthing("type", r, t);
206: }
207:
208:
209: many(s, c)
210: char *s, c;
211: {
212: char buff[25];
213:
214: sprintf(buff, "Too many %s. Try the -N%c option", s, c);
215: fatal(buff);
216: }
217:
218:
219: err66(s)
220: char *s;
221: {
222: errstr("Fortran 77 feature used: %s", s);
223: }
224:
225:
226:
227: errext(s)
228: char *s;
229: {
230: errstr("F77 compiler extension used: %s", s);
231: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.