1*0a6a1f1dSLionel Sambuc /* $NetBSD: error.c,v 1.10 2015/01/04 01:34:20 christos Exp $ */
24a17663cSThomas Veerman
34a17663cSThomas Veerman #include "defs.h"
44a17663cSThomas Veerman
54a17663cSThomas Veerman #include <sys/cdefs.h>
6*0a6a1f1dSLionel Sambuc __RCSID("$NetBSD: error.c,v 1.10 2015/01/04 01:34:20 christos Exp $");
7*0a6a1f1dSLionel Sambuc /* Id: error.c,v 1.11 2014/04/07 22:22:49 tom Exp */
84a17663cSThomas Veerman
94a17663cSThomas Veerman /* routines for printing error messages */
104a17663cSThomas Veerman
114a17663cSThomas Veerman __dead void
fatal(const char * msg)124a17663cSThomas Veerman fatal(const char *msg)
134a17663cSThomas Veerman {
144a17663cSThomas Veerman fprintf(stderr, "%s: f - %s\n", myname, msg);
154a17663cSThomas Veerman done(2);
164a17663cSThomas Veerman }
174a17663cSThomas Veerman
184a17663cSThomas Veerman __dead void
no_space(void)194a17663cSThomas Veerman no_space(void)
204a17663cSThomas Veerman {
214a17663cSThomas Veerman fprintf(stderr, "%s: f - out of space\n", myname);
224a17663cSThomas Veerman done(2);
234a17663cSThomas Veerman }
244a17663cSThomas Veerman
254a17663cSThomas Veerman __dead void
open_error(const char * filename)264a17663cSThomas Veerman open_error(const char *filename)
274a17663cSThomas Veerman {
284a17663cSThomas Veerman fprintf(stderr, "%s: f - cannot open \"%s\"\n", myname, filename);
294a17663cSThomas Veerman done(2);
304a17663cSThomas Veerman }
314a17663cSThomas Veerman
324a17663cSThomas Veerman void
missing_brace(void)334a17663cSThomas Veerman missing_brace(void)
344a17663cSThomas Veerman {
354a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", missing '}'\n",
364a17663cSThomas Veerman myname, lineno, input_file_name);
374a17663cSThomas Veerman done(1);
384a17663cSThomas Veerman }
394a17663cSThomas Veerman
404a17663cSThomas Veerman void
unexpected_EOF(void)414a17663cSThomas Veerman unexpected_EOF(void)
424a17663cSThomas Veerman {
434a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", unexpected end-of-file\n",
444a17663cSThomas Veerman myname, lineno, input_file_name);
454a17663cSThomas Veerman done(1);
464a17663cSThomas Veerman }
474a17663cSThomas Veerman
484a17663cSThomas Veerman static void
print_pos(const char * st_line,const char * st_cptr)49*0a6a1f1dSLionel Sambuc print_pos(const char *st_line, const char *st_cptr)
504a17663cSThomas Veerman {
51*0a6a1f1dSLionel Sambuc const char *s;
524a17663cSThomas Veerman
534a17663cSThomas Veerman if (st_line == 0)
544a17663cSThomas Veerman return;
554a17663cSThomas Veerman for (s = st_line; *s != '\n'; ++s)
564a17663cSThomas Veerman {
574a17663cSThomas Veerman if (isprint(UCH(*s)) || *s == '\t')
584a17663cSThomas Veerman putc(*s, stderr);
594a17663cSThomas Veerman else
604a17663cSThomas Veerman putc('?', stderr);
614a17663cSThomas Veerman }
624a17663cSThomas Veerman putc('\n', stderr);
634a17663cSThomas Veerman for (s = st_line; s < st_cptr; ++s)
644a17663cSThomas Veerman {
654a17663cSThomas Veerman if (*s == '\t')
664a17663cSThomas Veerman putc('\t', stderr);
674a17663cSThomas Veerman else
684a17663cSThomas Veerman putc(' ', stderr);
694a17663cSThomas Veerman }
704a17663cSThomas Veerman putc('^', stderr);
714a17663cSThomas Veerman putc('\n', stderr);
724a17663cSThomas Veerman }
734a17663cSThomas Veerman
744a17663cSThomas Veerman __dead void
syntax_error(int st_lineno,char * st_line,char * st_cptr)754a17663cSThomas Veerman syntax_error(int st_lineno, char *st_line, char *st_cptr)
764a17663cSThomas Veerman {
774a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", syntax error\n",
784a17663cSThomas Veerman myname, st_lineno, input_file_name);
794a17663cSThomas Veerman print_pos(st_line, st_cptr);
804a17663cSThomas Veerman done(1);
814a17663cSThomas Veerman }
824a17663cSThomas Veerman
834a17663cSThomas Veerman __dead void
unterminated_comment(const struct ainfo * a)84*0a6a1f1dSLionel Sambuc unterminated_comment(const struct ainfo *a)
854a17663cSThomas Veerman {
864a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", unmatched /*\n",
87*0a6a1f1dSLionel Sambuc myname, a->a_lineno, input_file_name);
88*0a6a1f1dSLionel Sambuc print_pos(a->a_line, a->a_cptr);
894a17663cSThomas Veerman done(1);
904a17663cSThomas Veerman }
914a17663cSThomas Veerman
924a17663cSThomas Veerman __dead void
unterminated_string(const struct ainfo * a)93*0a6a1f1dSLionel Sambuc unterminated_string(const struct ainfo *a)
944a17663cSThomas Veerman {
954a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", unterminated string\n",
96*0a6a1f1dSLionel Sambuc myname, a->a_lineno, input_file_name);
97*0a6a1f1dSLionel Sambuc print_pos(a->a_line, a->a_cptr);
984a17663cSThomas Veerman done(1);
994a17663cSThomas Veerman }
1004a17663cSThomas Veerman
1014a17663cSThomas Veerman __dead void
unterminated_text(const struct ainfo * a)102*0a6a1f1dSLionel Sambuc unterminated_text(const struct ainfo *a)
1034a17663cSThomas Veerman {
1044a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", unmatched %%{\n",
105*0a6a1f1dSLionel Sambuc myname, a->a_lineno, input_file_name);
106*0a6a1f1dSLionel Sambuc print_pos(a->a_line, a->a_cptr);
1074a17663cSThomas Veerman done(1);
1084a17663cSThomas Veerman }
1094a17663cSThomas Veerman
1104a17663cSThomas Veerman __dead void
unterminated_union(const struct ainfo * a)111*0a6a1f1dSLionel Sambuc unterminated_union(const struct ainfo *a)
1124a17663cSThomas Veerman {
1134a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", unterminated %%union \
114*0a6a1f1dSLionel Sambuc declaration\n", myname, a->a_lineno, input_file_name);
115*0a6a1f1dSLionel Sambuc print_pos(a->a_line, a->a_cptr);
1164a17663cSThomas Veerman done(1);
1174a17663cSThomas Veerman }
1184a17663cSThomas Veerman
1194a17663cSThomas Veerman __dead void
over_unionized(char * u_cptr)1204a17663cSThomas Veerman over_unionized(char *u_cptr)
1214a17663cSThomas Veerman {
1224a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", too many %%union \
1234a17663cSThomas Veerman declarations\n", myname, lineno, input_file_name);
1244a17663cSThomas Veerman print_pos(line, u_cptr);
1254a17663cSThomas Veerman done(1);
1264a17663cSThomas Veerman }
1274a17663cSThomas Veerman
1284a17663cSThomas Veerman __dead void
illegal_tag(int t_lineno,char * t_line,char * t_cptr)1294a17663cSThomas Veerman illegal_tag(int t_lineno, char *t_line, char *t_cptr)
1304a17663cSThomas Veerman {
1314a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", illegal tag\n",
1324a17663cSThomas Veerman myname, t_lineno, input_file_name);
1334a17663cSThomas Veerman print_pos(t_line, t_cptr);
1344a17663cSThomas Veerman done(1);
1354a17663cSThomas Veerman }
1364a17663cSThomas Veerman
1374a17663cSThomas Veerman __dead void
illegal_character(char * c_cptr)1384a17663cSThomas Veerman illegal_character(char *c_cptr)
1394a17663cSThomas Veerman {
1404a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", illegal character\n",
1414a17663cSThomas Veerman myname, lineno, input_file_name);
1424a17663cSThomas Veerman print_pos(line, c_cptr);
1434a17663cSThomas Veerman done(1);
1444a17663cSThomas Veerman }
1454a17663cSThomas Veerman
1464a17663cSThomas Veerman __dead void
used_reserved(char * s)1474a17663cSThomas Veerman used_reserved(char *s)
1484a17663cSThomas Veerman {
1494a17663cSThomas Veerman fprintf(stderr,
1504a17663cSThomas Veerman "%s: e - line %d of \"%s\", illegal use of reserved symbol \
1514a17663cSThomas Veerman %s\n", myname, lineno, input_file_name, s);
1524a17663cSThomas Veerman done(1);
1534a17663cSThomas Veerman }
1544a17663cSThomas Veerman
1554a17663cSThomas Veerman __dead void
tokenized_start(char * s)1564a17663cSThomas Veerman tokenized_start(char *s)
1574a17663cSThomas Veerman {
1584a17663cSThomas Veerman fprintf(stderr,
1594a17663cSThomas Veerman "%s: e - line %d of \"%s\", the start symbol %s cannot be \
1604a17663cSThomas Veerman declared to be a token\n", myname, lineno, input_file_name, s);
1614a17663cSThomas Veerman done(1);
1624a17663cSThomas Veerman }
1634a17663cSThomas Veerman
1644a17663cSThomas Veerman void
retyped_warning(char * s)1654a17663cSThomas Veerman retyped_warning(char *s)
1664a17663cSThomas Veerman {
1674a17663cSThomas Veerman fprintf(stderr, "%s: w - line %d of \"%s\", the type of %s has been \
1684a17663cSThomas Veerman redeclared\n", myname, lineno, input_file_name, s);
1694a17663cSThomas Veerman }
1704a17663cSThomas Veerman
1714a17663cSThomas Veerman void
reprec_warning(char * s)1724a17663cSThomas Veerman reprec_warning(char *s)
1734a17663cSThomas Veerman {
1744a17663cSThomas Veerman fprintf(stderr,
1754a17663cSThomas Veerman "%s: w - line %d of \"%s\", the precedence of %s has been \
1764a17663cSThomas Veerman redeclared\n", myname, lineno, input_file_name, s);
1774a17663cSThomas Veerman }
1784a17663cSThomas Veerman
1794a17663cSThomas Veerman void
revalued_warning(char * s)1804a17663cSThomas Veerman revalued_warning(char *s)
1814a17663cSThomas Veerman {
1824a17663cSThomas Veerman fprintf(stderr, "%s: w - line %d of \"%s\", the value of %s has been \
1834a17663cSThomas Veerman redeclared\n", myname, lineno, input_file_name, s);
1844a17663cSThomas Veerman }
1854a17663cSThomas Veerman
1864a17663cSThomas Veerman void
terminal_start(char * s)1874a17663cSThomas Veerman terminal_start(char *s)
1884a17663cSThomas Veerman {
1894a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", the start symbol %s is a \
1904a17663cSThomas Veerman token\n", myname, lineno, input_file_name, s);
1914a17663cSThomas Veerman done(1);
1924a17663cSThomas Veerman }
1934a17663cSThomas Veerman
1944a17663cSThomas Veerman void
restarted_warning(void)1954a17663cSThomas Veerman restarted_warning(void)
1964a17663cSThomas Veerman {
1974a17663cSThomas Veerman fprintf(stderr, "%s: w - line %d of \"%s\", the start symbol has been \
1984a17663cSThomas Veerman redeclared\n", myname, lineno, input_file_name);
1994a17663cSThomas Veerman }
2004a17663cSThomas Veerman
2014a17663cSThomas Veerman void
no_grammar(void)2024a17663cSThomas Veerman no_grammar(void)
2034a17663cSThomas Veerman {
2044a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", no grammar has been \
2054a17663cSThomas Veerman specified\n", myname, lineno, input_file_name);
2064a17663cSThomas Veerman done(1);
2074a17663cSThomas Veerman }
2084a17663cSThomas Veerman
2094a17663cSThomas Veerman void
terminal_lhs(int s_lineno)2104a17663cSThomas Veerman terminal_lhs(int s_lineno)
2114a17663cSThomas Veerman {
2124a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", a token appears on the lhs \
2134a17663cSThomas Veerman of a production\n", myname, s_lineno, input_file_name);
2144a17663cSThomas Veerman done(1);
2154a17663cSThomas Veerman }
2164a17663cSThomas Veerman
2174a17663cSThomas Veerman void
prec_redeclared(void)2184a17663cSThomas Veerman prec_redeclared(void)
2194a17663cSThomas Veerman {
2204a17663cSThomas Veerman fprintf(stderr, "%s: w - line %d of \"%s\", conflicting %%prec \
2214a17663cSThomas Veerman specifiers\n", myname, lineno, input_file_name);
2224a17663cSThomas Veerman }
2234a17663cSThomas Veerman
2244a17663cSThomas Veerman void
unterminated_action(const struct ainfo * a)225*0a6a1f1dSLionel Sambuc unterminated_action(const struct ainfo *a)
2264a17663cSThomas Veerman {
2274a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", unterminated action\n",
228*0a6a1f1dSLionel Sambuc myname, a->a_lineno, input_file_name);
229*0a6a1f1dSLionel Sambuc print_pos(a->a_line, a->a_cptr);
2304a17663cSThomas Veerman done(1);
2314a17663cSThomas Veerman }
2324a17663cSThomas Veerman
2334a17663cSThomas Veerman void
dollar_warning(int a_lineno,int i)2344a17663cSThomas Veerman dollar_warning(int a_lineno, int i)
2354a17663cSThomas Veerman {
2364a17663cSThomas Veerman fprintf(stderr, "%s: w - line %d of \"%s\", $%d references beyond the \
2374a17663cSThomas Veerman end of the current rule\n", myname, a_lineno, input_file_name, i);
2384a17663cSThomas Veerman }
2394a17663cSThomas Veerman
2404a17663cSThomas Veerman __dead void
dollar_error(int a_lineno,char * a_line,char * a_cptr)2414a17663cSThomas Veerman dollar_error(int a_lineno, char *a_line, char *a_cptr)
2424a17663cSThomas Veerman {
2434a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", illegal $-name\n",
2444a17663cSThomas Veerman myname, a_lineno, input_file_name);
2454a17663cSThomas Veerman print_pos(a_line, a_cptr);
2464a17663cSThomas Veerman done(1);
2474a17663cSThomas Veerman }
2484a17663cSThomas Veerman
2494a17663cSThomas Veerman __dead void
untyped_lhs(void)2504a17663cSThomas Veerman untyped_lhs(void)
2514a17663cSThomas Veerman {
2524a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", $$ is untyped\n",
2534a17663cSThomas Veerman myname, lineno, input_file_name);
2544a17663cSThomas Veerman done(1);
2554a17663cSThomas Veerman }
2564a17663cSThomas Veerman
2574a17663cSThomas Veerman __dead void
untyped_rhs(int i,char * s)2584a17663cSThomas Veerman untyped_rhs(int i, char *s)
2594a17663cSThomas Veerman {
2604a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", $%d (%s) is untyped\n",
2614a17663cSThomas Veerman myname, lineno, input_file_name, i, s);
2624a17663cSThomas Veerman done(1);
2634a17663cSThomas Veerman }
2644a17663cSThomas Veerman
2654a17663cSThomas Veerman __dead void
unknown_rhs(int i)2664a17663cSThomas Veerman unknown_rhs(int i)
2674a17663cSThomas Veerman {
2684a17663cSThomas Veerman fprintf(stderr, "%s: e - line %d of \"%s\", $%d is untyped\n",
2694a17663cSThomas Veerman myname, lineno, input_file_name, i);
2704a17663cSThomas Veerman done(1);
2714a17663cSThomas Veerman }
2724a17663cSThomas Veerman
2734a17663cSThomas Veerman void
default_action_warning(void)2744a17663cSThomas Veerman default_action_warning(void)
2754a17663cSThomas Veerman {
2764a17663cSThomas Veerman fprintf(stderr,
2774a17663cSThomas Veerman "%s: w - line %d of \"%s\", the default action assigns an \
2784a17663cSThomas Veerman undefined value to $$\n", myname, lineno, input_file_name);
2794a17663cSThomas Veerman }
2804a17663cSThomas Veerman
2814a17663cSThomas Veerman void
undefined_goal(char * s)2824a17663cSThomas Veerman undefined_goal(char *s)
2834a17663cSThomas Veerman {
2844a17663cSThomas Veerman fprintf(stderr, "%s: e - the start symbol %s is undefined\n", myname, s);
2854a17663cSThomas Veerman done(1);
2864a17663cSThomas Veerman }
2874a17663cSThomas Veerman
2884a17663cSThomas Veerman void
undefined_symbol_warning(char * s)2894a17663cSThomas Veerman undefined_symbol_warning(char *s)
2904a17663cSThomas Veerman {
2914a17663cSThomas Veerman fprintf(stderr, "%s: w - the symbol %s is undefined\n", myname, s);
2924a17663cSThomas Veerman }
293*0a6a1f1dSLionel Sambuc
294*0a6a1f1dSLionel Sambuc #if ! defined(YYBTYACC)
295*0a6a1f1dSLionel Sambuc void
unsupported_flag_warning(const char * flag,const char * details)296*0a6a1f1dSLionel Sambuc unsupported_flag_warning(const char *flag, const char *details)
297*0a6a1f1dSLionel Sambuc {
298*0a6a1f1dSLionel Sambuc fprintf(stderr, "%s: w - %s flag unsupported, %s\n",
299*0a6a1f1dSLionel Sambuc myname, flag, details);
300*0a6a1f1dSLionel Sambuc }
301*0a6a1f1dSLionel Sambuc #endif
302*0a6a1f1dSLionel Sambuc
303*0a6a1f1dSLionel Sambuc #if defined(YYBTYACC)
304*0a6a1f1dSLionel Sambuc void
at_warning(int a_lineno,int i)305*0a6a1f1dSLionel Sambuc at_warning(int a_lineno, int i)
306*0a6a1f1dSLionel Sambuc {
307*0a6a1f1dSLionel Sambuc fprintf(stderr, "%s: w - line %d of \"%s\", @%d references beyond the \
308*0a6a1f1dSLionel Sambuc end of the current rule\n", myname, a_lineno, input_file_name, i);
309*0a6a1f1dSLionel Sambuc }
310*0a6a1f1dSLionel Sambuc
311*0a6a1f1dSLionel Sambuc void
at_error(int a_lineno,char * a_line,char * a_cptr)312*0a6a1f1dSLionel Sambuc at_error(int a_lineno, char *a_line, char *a_cptr)
313*0a6a1f1dSLionel Sambuc {
314*0a6a1f1dSLionel Sambuc fprintf(stderr,
315*0a6a1f1dSLionel Sambuc "%s: e - line %d of \"%s\", illegal @$ or @N reference\n",
316*0a6a1f1dSLionel Sambuc myname, a_lineno, input_file_name);
317*0a6a1f1dSLionel Sambuc print_pos(a_line, a_cptr);
318*0a6a1f1dSLionel Sambuc done(1);
319*0a6a1f1dSLionel Sambuc }
320*0a6a1f1dSLionel Sambuc
321*0a6a1f1dSLionel Sambuc void
unterminated_arglist(const struct ainfo * a)322*0a6a1f1dSLionel Sambuc unterminated_arglist(const struct ainfo *a)
323*0a6a1f1dSLionel Sambuc {
324*0a6a1f1dSLionel Sambuc fprintf(stderr,
325*0a6a1f1dSLionel Sambuc "%s: e - line %d of \"%s\", unterminated argument list\n",
326*0a6a1f1dSLionel Sambuc myname, a->a_lineno, input_file_name);
327*0a6a1f1dSLionel Sambuc print_pos(a->a_line, a->a_cptr);
328*0a6a1f1dSLionel Sambuc done(1);
329*0a6a1f1dSLionel Sambuc }
330*0a6a1f1dSLionel Sambuc
331*0a6a1f1dSLionel Sambuc void
arg_number_disagree_warning(int a_lineno,char * a_name)332*0a6a1f1dSLionel Sambuc arg_number_disagree_warning(int a_lineno, char *a_name)
333*0a6a1f1dSLionel Sambuc {
334*0a6a1f1dSLionel Sambuc fprintf(stderr, "%s: w - line %d of \"%s\", number of arguments of %s "
335*0a6a1f1dSLionel Sambuc "doesn't agree with previous declaration\n",
336*0a6a1f1dSLionel Sambuc myname, a_lineno, input_file_name, a_name);
337*0a6a1f1dSLionel Sambuc }
338*0a6a1f1dSLionel Sambuc
339*0a6a1f1dSLionel Sambuc void
bad_formals(void)340*0a6a1f1dSLionel Sambuc bad_formals(void)
341*0a6a1f1dSLionel Sambuc {
342*0a6a1f1dSLionel Sambuc fprintf(stderr, "%s: e - line %d of \"%s\", bad formal argument list\n",
343*0a6a1f1dSLionel Sambuc myname, lineno, input_file_name);
344*0a6a1f1dSLionel Sambuc print_pos(line, cptr);
345*0a6a1f1dSLionel Sambuc done(1);
346*0a6a1f1dSLionel Sambuc }
347*0a6a1f1dSLionel Sambuc
348*0a6a1f1dSLionel Sambuc void
arg_type_disagree_warning(int a_lineno,int i,char * a_name)349*0a6a1f1dSLionel Sambuc arg_type_disagree_warning(int a_lineno, int i, char *a_name)
350*0a6a1f1dSLionel Sambuc {
351*0a6a1f1dSLionel Sambuc fprintf(stderr, "%s: w - line %d of \"%s\", type of argument %d "
352*0a6a1f1dSLionel Sambuc "to %s doesn't agree with previous declaration\n",
353*0a6a1f1dSLionel Sambuc myname, a_lineno, input_file_name, i, a_name);
354*0a6a1f1dSLionel Sambuc }
355*0a6a1f1dSLionel Sambuc
356*0a6a1f1dSLionel Sambuc void
unknown_arg_warning(int d_lineno,const char * dlr_opt,const char * d_arg,const char * d_line,const char * d_cptr)357*0a6a1f1dSLionel Sambuc unknown_arg_warning(int d_lineno, const char *dlr_opt, const char *d_arg, const char
358*0a6a1f1dSLionel Sambuc *d_line, const char *d_cptr)
359*0a6a1f1dSLionel Sambuc {
360*0a6a1f1dSLionel Sambuc fprintf(stderr, "%s: w - line %d of \"%s\", unknown argument %s%s\n",
361*0a6a1f1dSLionel Sambuc myname, d_lineno, input_file_name, dlr_opt, d_arg);
362*0a6a1f1dSLionel Sambuc print_pos(d_line, d_cptr);
363*0a6a1f1dSLionel Sambuc }
364*0a6a1f1dSLionel Sambuc
365*0a6a1f1dSLionel Sambuc void
untyped_arg_warning(int a_lineno,const char * dlr_opt,const char * a_name)366*0a6a1f1dSLionel Sambuc untyped_arg_warning(int a_lineno, const char *dlr_opt, const char *a_name)
367*0a6a1f1dSLionel Sambuc {
368*0a6a1f1dSLionel Sambuc fprintf(stderr, "%s: w - line %d of \"%s\", untyped argument %s%s\n",
369*0a6a1f1dSLionel Sambuc myname, a_lineno, input_file_name, dlr_opt, a_name);
370*0a6a1f1dSLionel Sambuc }
371*0a6a1f1dSLionel Sambuc
372*0a6a1f1dSLionel Sambuc void
wrong_number_args_warning(const char * which,const char * a_name)373*0a6a1f1dSLionel Sambuc wrong_number_args_warning(const char *which, const char *a_name)
374*0a6a1f1dSLionel Sambuc {
375*0a6a1f1dSLionel Sambuc fprintf(stderr,
376*0a6a1f1dSLionel Sambuc "%s: w - line %d of \"%s\", wrong number of %sarguments for %s\n",
377*0a6a1f1dSLionel Sambuc myname, lineno, input_file_name, which, a_name);
378*0a6a1f1dSLionel Sambuc print_pos(line, cptr);
379*0a6a1f1dSLionel Sambuc }
380*0a6a1f1dSLionel Sambuc
381*0a6a1f1dSLionel Sambuc void
wrong_type_for_arg_warning(int i,char * a_name)382*0a6a1f1dSLionel Sambuc wrong_type_for_arg_warning(int i, char *a_name)
383*0a6a1f1dSLionel Sambuc {
384*0a6a1f1dSLionel Sambuc fprintf(stderr,
385*0a6a1f1dSLionel Sambuc "%s: w - line %d of \"%s\", wrong type for default argument %d to %s\n",
386*0a6a1f1dSLionel Sambuc myname, lineno, input_file_name, i, a_name);
387*0a6a1f1dSLionel Sambuc print_pos(line, cptr);
388*0a6a1f1dSLionel Sambuc }
389*0a6a1f1dSLionel Sambuc
390*0a6a1f1dSLionel Sambuc void
start_requires_args(char * a_name)391*0a6a1f1dSLionel Sambuc start_requires_args(char *a_name)
392*0a6a1f1dSLionel Sambuc {
393*0a6a1f1dSLionel Sambuc fprintf(stderr,
394*0a6a1f1dSLionel Sambuc "%s: w - line %d of \"%s\", start symbol %s requires arguments\n",
395*0a6a1f1dSLionel Sambuc myname, 0, input_file_name, a_name);
396*0a6a1f1dSLionel Sambuc
397*0a6a1f1dSLionel Sambuc }
398*0a6a1f1dSLionel Sambuc
399*0a6a1f1dSLionel Sambuc void
destructor_redeclared_warning(const struct ainfo * a)400*0a6a1f1dSLionel Sambuc destructor_redeclared_warning(const struct ainfo *a)
401*0a6a1f1dSLionel Sambuc {
402*0a6a1f1dSLionel Sambuc fprintf(stderr, "%s: w - line %d of \"%s\", destructor redeclared\n",
403*0a6a1f1dSLionel Sambuc myname, a->a_lineno, input_file_name);
404*0a6a1f1dSLionel Sambuc print_pos(a->a_line, a->a_cptr);
405*0a6a1f1dSLionel Sambuc }
406*0a6a1f1dSLionel Sambuc #endif
407