Commit | Line | Data |
---|---|---|
eb5ad1d2 F |
1 | #include "defs" |
2 | ||
3 | ||
4 | warn1(s,t) | |
5 | char *s, *t; | |
6 | { | |
7 | char buff[100]; | |
8 | warn( sprintf(buff, s, t) ); | |
9 | } | |
10 | ||
11 | ||
12 | warn(s) | |
13 | char *s; | |
14 | { | |
15 | if(nowarnflag) | |
16 | return; | |
17 | fprintf(diagfile, "Warning on line %d of %s: %s\n", lineno, infname, s); | |
18 | ++nwarn; | |
19 | } | |
20 | ||
21 | ||
22 | ||
23 | err2(s,t,u) | |
24 | char *s, *t, *u; | |
25 | { | |
26 | char buff[100]; | |
27 | err( sprintf(buff, s, t, u) ); | |
28 | } | |
29 | ||
30 | ||
31 | err1(s,t) | |
32 | char *s, *t; | |
33 | { | |
34 | char buff[100]; | |
35 | err( sprintf(buff, s, t) ); | |
36 | } | |
37 | ||
38 | ||
39 | err(s) | |
40 | char *s; | |
41 | { | |
42 | fprintf(diagfile, "Error on line %d of %s: %s\n", lineno, infname, s); | |
43 | ++nerr; | |
44 | } | |
45 | ||
46 | ||
47 | yyerror(s) | |
48 | char *s; | |
49 | { err(s); } | |
50 | ||
51 | ||
52 | ||
53 | dclerr(s, v) | |
54 | char *s; | |
55 | struct nameblock *v; | |
56 | { | |
57 | char buff[100]; | |
58 | ||
59 | if(v) | |
60 | err( sprintf(buff, "Declaration error for %s: %s", varstr(VL, v->varname), s) ); | |
61 | else | |
62 | err1("Declaration error %s", s); | |
63 | } | |
64 | ||
65 | ||
66 | ||
67 | execerr(s, n) | |
68 | char *s, *n; | |
69 | { | |
70 | char buf1[100], buf2[100]; | |
71 | ||
72 | sprintf(buf1, "Execution error %s", s); | |
73 | err( sprintf(buf2, buf1, n) ); | |
74 | } | |
75 | ||
76 | ||
77 | fatal(t) | |
78 | char *t; | |
79 | { | |
80 | fprintf(diagfile, "Compiler error line %d of %s: %s\n", lineno, infname, t); | |
81 | if(debugflag) | |
82 | abort(); | |
83 | done(3); | |
84 | exit(3); | |
85 | } | |
86 | ||
87 | ||
88 | ||
89 | ||
90 | fatal1(t,d) | |
91 | char *t, *d; | |
92 | { | |
93 | char buff[100]; | |
94 | fatal( sprintf(buff, t, d) ); | |
95 | } |