1 /* Top level of GNU C compiler
2 Copyright (C) 1999 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
22 /* This file implements the language independant aspect of diagnostic
26 #undef FLOAT /* This is for hpux. They should change hpux. */
27 #undef FFS /* Some systems define this in param.h. */
35 #include "insn-attr.h"
36 #include "insn-codes.h"
37 #include "insn-config.h"
42 #define obstack_chunk_alloc xmalloc
43 #define obstack_chunk_free free
47 struct obstack obstack
; /* where we build the text to output */
48 const char *prefix
; /* prefix of every new line */
49 int line_length
; /* current line length (in characters) */
50 int max_length
; /* maximum characters per line */
54 static int doing_line_wrapping
PROTO((void));
55 static void init_output_buffer
PROTO((struct output_buffer
*,
57 static const char *get_output_prefix
PROTO((const struct output_buffer
*));
58 static int output_space_left
PROTO((const struct output_buffer
*));
59 static void emit_output_prefix
PROTO((struct output_buffer
*));
60 static void output_newline
PROTO((struct output_buffer
*));
61 static void output_append
PROTO((struct output_buffer
*, const char *,
63 static void output_puts
PROTO((struct output_buffer
*, const char *));
64 static void dump_output
PROTO((struct output_buffer
*, FILE *));
65 static const char *vbuild_message_string
PROTO((const char *, va_list));
66 static const char *build_message_string
PVPROTO((const char *, ...));
67 static const char *build_location_prefix
PROTO((const char *, int, int));
68 static void voutput_notice
PROTO((struct output_buffer
*, const char *,
70 static void output_printf
PVPROTO((struct output_buffer
*, const char *, ...));
71 static void line_wrapper_printf
PVPROTO((FILE *, const char *, ...));
72 static void vline_wrapper_message_with_location
PROTO((const char *, int, int,
73 const char *, va_list));
74 static void notice
PVPROTO((const char *s
, ...)) ATTRIBUTE_PRINTF_1
;
75 static void v_message_with_file_and_line
PROTO((const char *, int, int,
76 const char *, va_list));
77 static void v_message_with_decl
PROTO((tree
, int, const char *, va_list));
78 static void file_and_line_for_asm
PROTO((rtx
, char **, int *));
79 static void v_error_with_file_and_line
PROTO((const char *, int,
80 const char *, va_list));
81 static void v_error_with_decl
PROTO((tree
, const char *, va_list));
82 static void v_error_for_asm
PROTO((rtx
, const char *, va_list));
83 static void verror
PROTO((const char *, va_list));
84 static void vfatal
PROTO((const char *, va_list)) ATTRIBUTE_NORETURN
;
85 static void v_warning_with_file_and_line
PROTO ((const char *, int,
86 const char *, va_list));
87 static void v_warning_with_decl
PROTO((tree
, const char *, va_list));
88 static void v_warning_for_asm
PROTO((rtx
, const char *, va_list));
89 static void vwarning
PROTO((const char *, va_list));
90 static void vpedwarn
PROTO((const char *, va_list));
91 static void v_pedwarn_with_decl
PROTO((tree
, const char *, va_list));
92 static void v_pedwarn_with_file_and_line
PROTO((const char *, int,
93 const char *, va_list));
94 static void vsorry
PROTO((const char *, va_list));
95 static void report_file_and_line
PROTO ((const char *, int, int));
96 static void vnotice
PROTO ((FILE *, const char *, va_list));
99 extern int rtl_dump_and_exit
;
100 extern int inhibit_warnings
;
101 extern int warnings_are_errors
;
102 extern int warningcount
;
103 extern int errorcount
;
105 static int need_error_newline
;
107 /* Function of last error message;
108 more generally, function such that if next error message is in it
109 then we don't have to mention the function name. */
110 static tree last_error_function
= NULL
;
112 /* Used to detect when input_file_stack has changed since last described. */
113 static int last_error_tick
;
115 /* Called by report_error_function to print out function name.
116 * Default may be overridden by language front-ends. */
118 void (*print_error_function
) PROTO((const char *)) =
119 default_print_error_function
;
121 /* Maximum characters per line in automatic line wrapping mode.
122 Non Zero means don't wrap lines. */
124 static int output_maximum_width
= 0;
126 /* Predicate. Return 1 if we're in automatic line wrapping mode. */
129 doing_line_wrapping ()
131 return output_maximum_width
> 0;
134 /* Set Maximum characters per line in automatic line wrapping mode. */
137 set_message_length (n
)
140 output_maximum_width
= n
;
143 /* Construct an output BUFFER with PREFIX and of MAX_LENGTH characters
147 init_output_buffer (buffer
, prefix
, max_length
)
148 struct output_buffer
*buffer
;
152 obstack_init (&buffer
->obstack
);
153 buffer
->prefix
= prefix
;
154 buffer
->line_length
= 0;
155 buffer
->max_length
= max_length
;
158 /* Return BUFFER's prefix. */
161 get_output_prefix (buffer
)
162 const struct output_buffer
*buffer
;
164 return buffer
->prefix
;
167 /* Return the amount of characters BUFFER can accept to
171 output_space_left (buffer
)
172 const struct output_buffer
*buffer
;
174 return buffer
->max_length
- buffer
->line_length
;
177 /* Dump BUFFER's prefix. */
180 emit_output_prefix (buffer
)
181 struct output_buffer
*buffer
;
185 buffer
->line_length
= strlen (buffer
->prefix
);
186 obstack_grow (&buffer
->obstack
, buffer
->prefix
, buffer
->line_length
);
190 /* Have BUFFER start a new line. */
193 output_newline (buffer
)
194 struct output_buffer
*buffer
;
196 obstack_1grow (&buffer
->obstack
, '\n');
197 buffer
->line_length
= 0;
200 /* Append a string deliminated by START and END to BUFFER. No wrapping is
201 done. The caller must ensure that it is safe to do so. */
204 output_append (buffer
, start
, end
)
205 struct output_buffer
*buffer
;
211 /* Emit prefix and skip whitespace if we're starting a new line. */
212 if (buffer
->line_length
== 0)
214 emit_output_prefix (buffer
);
215 while (start
!= end
&& *start
== ' ')
219 obstack_grow (&buffer
->obstack
, start
, n
);
220 buffer
->line_length
+= n
;
223 /* Wrap a STRing into BUFFER. */
226 output_puts (buffer
, str
)
227 struct output_buffer
*buffer
;
234 while (*p
&& *p
!= ' ' && *p
!= '\n')
237 if (p
- str
< output_space_left (buffer
))
238 output_append (buffer
, str
, p
);
241 output_newline (buffer
);
242 output_append (buffer
, str
, p
);
245 while (*p
&& *p
== '\n')
247 output_newline (buffer
);
255 /* Dump the content of BUFFER into FILE. */
258 dump_output (buffer
, file
)
259 struct output_buffer
*buffer
;
264 obstack_1grow (&buffer
->obstack
, '\0');
265 text
= obstack_finish (&buffer
->obstack
);
267 obstack_free (&buffer
->obstack
, (char *)text
);
268 buffer
->line_length
= 0;
272 vbuild_message_string (msgid
, ap
)
278 vasprintf (&str
, msgid
, ap
);
282 /* Return a malloc'd string containing MSGID formatted a la
283 printf. The caller is reponsible for freeing the memory. */
286 build_message_string
VPROTO((const char *msgid
, ...))
288 #ifndef ANSI_PROTOTYPES
294 VA_START (ap
, msgid
);
296 #ifndef ANSI_PROTOTYPES
297 msgid
= va_arg (ap
, const char *);
300 str
= vbuild_message_string (msgid
, ap
);
308 /* Return a malloc'd string describing a location. The caller is
309 responsible for freeing the memory. */
312 build_location_prefix (file
, line
, warn
)
317 const char *fmt
= file
318 ? (warn
? "%s:%d: warning: " : "%s:%d: ")
319 : (warn
? "%s: warning: " : "%s: ");
322 ? build_message_string (fmt
, file
, line
)
323 : build_message_string (fmt
, progname
);
326 /* Format a MESSAGE into BUFFER. Automatically wrap lines. */
329 voutput_notice (buffer
, msgid
, ap
)
330 struct output_buffer
*buffer
;
334 const char *message
= vbuild_message_string (msgid
, ap
);
336 output_puts (buffer
, message
);
337 free ((char *)message
);
341 /* Format a message into BUFFER a la printf. */
344 output_printf
VPROTO((struct output_buffer
*buffer
, const char *msgid
, ...))
346 #ifndef ANSI_PROTOTYPES
347 struct output_buffer
*buffer
;
352 VA_START (ap
, msgid
);
354 #ifndef ANSI_PROTOTYPES
355 buffer
= va_arg (ap
, struct output_buffer
*);
356 msgid
= va_arg (ap
, const char *);
359 voutput_notice (buffer
, msgid
, ap
);
364 /* Format a MESSAGE into FILE. Do line wrapping, starting new lines
368 line_wrapper_printf
VPROTO((FILE *file
, const char *msgid
, ...))
370 #ifndef ANSI_PROTOTYPES
374 struct output_buffer buffer
;
377 VA_START (ap
, msgid
);
379 #ifndef ANSI_PROTOTYPES
380 file
= va_arg (ap
, FILE *);
381 msgid
= va_arg (ap
, const char *);
384 init_output_buffer (&buffer
, (const char *)NULL
, output_maximum_width
);
385 voutput_notice (&buffer
, msgid
, ap
);
386 dump_output (&buffer
, file
);
393 vline_wrapper_message_with_location (file
, line
, warn
, msgid
, ap
)
400 struct output_buffer buffer
;
403 (&buffer
, build_location_prefix (file
, line
, warn
), output_maximum_width
);
404 voutput_notice (&buffer
, msgid
, ap
);
405 dump_output (&buffer
, stderr
);
406 free ((char*)get_output_prefix (&buffer
));
407 fputc ('\n', stderr
);
411 /* Print the message MSGID in FILE. */
414 vnotice (file
, msgid
, ap
)
419 vfprintf (file
, _(msgid
), ap
);
422 /* Print MSGID on stderr. */
425 notice
VPROTO((const char *msgid
, ...))
427 #ifndef ANSI_PROTOTYPES
432 VA_START (ap
, msgid
);
434 #ifndef ANSI_PROTOTYPES
435 msgid
= va_arg (ap
, char *);
438 vnotice (stderr
, msgid
, ap
);
442 /* Report FILE and LINE (or program name), and optionally just WARN. */
445 report_file_and_line (file
, line
, warn
)
451 fprintf (stderr
, "%s:%d: ", file
, line
);
453 fprintf (stderr
, "%s: ", progname
);
456 notice ("warning: ");
459 /* Print a message relevant to line LINE of file FILE. */
462 v_message_with_file_and_line (file
, line
, warn
, msgid
, ap
)
469 report_file_and_line (file
, line
, warn
);
470 vnotice (stderr
, msgid
, ap
);
471 fputc ('\n', stderr
);
474 /* Print a message relevant to the given DECL. */
477 v_message_with_decl (decl
, warn
, msgid
, ap
)
484 struct output_buffer buffer
;
486 if (doing_line_wrapping ())
489 build_location_prefix (DECL_SOURCE_FILE (decl
),
490 DECL_SOURCE_LINE (decl
), warn
),
491 output_maximum_width
);
493 report_file_and_line (DECL_SOURCE_FILE (decl
),
494 DECL_SOURCE_LINE (decl
), warn
);
496 /* Do magic to get around lack of varargs support for insertion
497 of arguments into existing list. We know that the decl is first;
498 we ass_u_me that it will be printed with "%s". */
500 for (p
= _(msgid
); *p
; ++p
)
506 else if (*(p
+ 1) != 's')
513 if (p
> _(msgid
)) /* Print the left-hand substring. */
515 if (doing_line_wrapping ())
516 output_printf (&buffer
, "%.*s", (int)(p
- _(msgid
)), _(msgid
));
518 fprintf (stderr
, "%.*s", (int)(p
- _(msgid
)), _(msgid
));
521 if (*p
== '%') /* Print the name. */
523 const char *n
= (DECL_NAME (decl
)
524 ? (*decl_printable_name
) (decl
, 2)
526 if (doing_line_wrapping ())
527 output_puts (&buffer
, n
);
533 if (ISALPHA (*(p
- 1) & 0xFF))
538 if (*p
) /* Print the rest of the message. */
540 if (doing_line_wrapping ())
541 voutput_notice (&buffer
, p
, ap
);
543 vfprintf (stderr
, p
, ap
);
546 if (doing_line_wrapping())
548 dump_output (&buffer
, stderr
);
549 free ((char *)get_output_prefix (&buffer
));
552 fputc ('\n', stderr
);
555 /* Figure file and line of the given INSN. */
558 file_and_line_for_asm (insn
, pfile
, pline
)
563 rtx body
= PATTERN (insn
);
566 /* Find the (or one of the) ASM_OPERANDS in the insn. */
567 if (GET_CODE (body
) == SET
&& GET_CODE (SET_SRC (body
)) == ASM_OPERANDS
)
568 asmop
= SET_SRC (body
);
569 else if (GET_CODE (body
) == ASM_OPERANDS
)
571 else if (GET_CODE (body
) == PARALLEL
572 && GET_CODE (XVECEXP (body
, 0, 0)) == SET
)
573 asmop
= SET_SRC (XVECEXP (body
, 0, 0));
574 else if (GET_CODE (body
) == PARALLEL
575 && GET_CODE (XVECEXP (body
, 0, 0)) == ASM_OPERANDS
)
576 asmop
= XVECEXP (body
, 0, 0);
582 *pfile
= ASM_OPERANDS_SOURCE_FILE (asmop
);
583 *pline
= ASM_OPERANDS_SOURCE_LINE (asmop
);
587 *pfile
= input_filename
;
592 /* Report an error at line LINE of file FILE. */
595 v_error_with_file_and_line (file
, line
, msgid
, ap
)
602 report_error_function (file
);
603 if (doing_line_wrapping ())
604 vline_wrapper_message_with_location (file
, line
, 0, msgid
, ap
);
606 v_message_with_file_and_line (file
, line
, 0, msgid
, ap
);
609 /* Report an error at the declaration DECL.
610 MSGID is a format string which uses %s to substitute the declaration
611 name; subsequent substitutions are a la printf. */
614 v_error_with_decl (decl
, msgid
, ap
)
620 report_error_function (DECL_SOURCE_FILE (decl
));
621 v_message_with_decl (decl
, 0, msgid
, ap
);
625 /* Report an error at the line number of the insn INSN.
626 This is used only when INSN is an `asm' with operands,
627 and each ASM_OPERANDS records its own source file and line. */
630 v_error_for_asm (insn
, msgid
, ap
)
639 file_and_line_for_asm (insn
, &file
, &line
);
640 report_error_function (file
);
641 v_message_with_file_and_line (file
, line
, 0, msgid
, ap
);
645 /* Report an error at the current line number. */
652 v_error_with_file_and_line (input_filename
, lineno
, msgid
, ap
);
656 /* Report a fatal error at the current line number. Allow a front end to
657 intercept the message. */
659 static void (*fatal_function
) PROTO ((const char *, va_list));
666 if (fatal_function
!= 0)
667 (*fatal_function
) (_(msgid
), ap
);
670 exit (FATAL_EXIT_CODE
);
673 /* Report a warning at line LINE of file FILE. */
676 v_warning_with_file_and_line (file
, line
, msgid
, ap
)
684 report_error_function (file
);
685 if (doing_line_wrapping ())
686 vline_wrapper_message_with_location (file
, line
, 1, msgid
, ap
);
688 v_message_with_file_and_line (file
, line
, 1, msgid
, ap
);
693 /* Report a warning at the declaration DECL.
694 MSGID is a format string which uses %s to substitute the declaration
695 name; subsequent substitutions are a la printf. */
698 v_warning_with_decl (decl
, msgid
, ap
)
705 report_error_function (DECL_SOURCE_FILE (decl
));
706 v_message_with_decl (decl
, 1, msgid
, ap
);
711 /* Report a warning at the line number of the insn INSN.
712 This is used only when INSN is an `asm' with operands,
713 and each ASM_OPERANDS records its own source file and line. */
716 v_warning_for_asm (insn
, msgid
, ap
)
726 file_and_line_for_asm (insn
, &file
, &line
);
727 report_error_function (file
);
728 v_message_with_file_and_line (file
, line
, 1, msgid
, ap
);
733 /* Report a warning at the current line number. */
740 v_warning_with_file_and_line (input_filename
, lineno
, msgid
, ap
);
743 /* These functions issue either warnings or errors depending on
751 if (flag_pedantic_errors
)
754 vwarning (msgid
, ap
);
759 v_pedwarn_with_decl (decl
, msgid
, ap
)
764 /* We don't want -pedantic-errors to cause the compilation to fail from
765 "errors" in system header files. Sometimes fixincludes can't fix what's
766 broken (eg: unsigned char bitfields - fixing it may change the alignment
767 which will cause programs to mysteriously fail because the C library
768 or kernel uses the original layout). There's no point in issuing a
769 warning either, it's just unnecessary noise. */
771 if (! DECL_IN_SYSTEM_HEADER (decl
))
773 if (flag_pedantic_errors
)
774 v_error_with_decl (decl
, msgid
, ap
);
776 v_warning_with_decl (decl
, msgid
, ap
);
782 v_pedwarn_with_file_and_line (file
, line
, msgid
, ap
)
788 if (flag_pedantic_errors
)
789 v_error_with_file_and_line (file
, line
, msgid
, ap
);
791 v_warning_with_file_and_line (file
, line
, msgid
, ap
);
795 /* Apologize for not implementing some feature. */
804 fprintf (stderr
, "%s:%d: ", input_filename
, lineno
);
806 fprintf (stderr
, "%s: ", progname
);
807 notice ("sorry, not implemented: ");
808 vnotice (stderr
, msgid
, ap
);
809 fputc ('\n', stderr
);
813 /* Count an error or warning. Return 1 if the message should be printed. */
816 count_error (warningp
)
819 if (warningp
&& inhibit_warnings
)
822 if (warningp
&& !warnings_are_errors
)
826 static int warning_message
= 0;
828 if (warningp
&& !warning_message
)
830 notice ("%s: warnings being treated as errors\n", progname
);
839 /* Print a diagnistic MSGID on FILE. */
841 fnotice
VPROTO((FILE *file
, const char *msgid
, ...))
843 #ifndef ANSI_PROTOTYPES
849 VA_START (ap
, msgid
);
851 #ifndef ANSI_PROTOTYPES
852 file
= va_arg (ap
, FILE *);
853 msgid
= va_arg (ap
, const char *);
856 vnotice (file
, msgid
, ap
);
861 /* Print a fatal error message. NAME is the text.
862 Also include a system error message based on `errno'. */
865 pfatal_with_name (name
)
868 fprintf (stderr
, "%s: ", progname
);
870 exit (FATAL_EXIT_CODE
);
874 fatal_io_error (name
)
877 notice ("%s: %s: I/O error\n", progname
, name
);
878 exit (FATAL_EXIT_CODE
);
881 /* Issue a pedantic warning MSGID. */
883 pedwarn
VPROTO((const char *msgid
, ...))
885 #ifndef ANSI_PROTOTYPES
890 VA_START (ap
, msgid
);
892 #ifndef ANSI_PROTOTYPES
893 msgid
= va_arg (ap
, const char *);
896 vpedwarn (msgid
, ap
);
900 /* Issue a pedantic waring about DECL. */
902 pedwarn_with_decl
VPROTO((tree decl
, const char *msgid
, ...))
904 #ifndef ANSI_PROTOTYPES
910 VA_START (ap
, msgid
);
912 #ifndef ANSI_PROTOTYPES
913 decl
= va_arg (ap
, tree
);
914 msgid
= va_arg (ap
, const char *);
917 v_pedwarn_with_decl (decl
, msgid
, ap
);
921 /* Same as above but within the context FILE and LINE. */
923 pedwarn_with_file_and_line
VPROTO((const char *file
, int line
,
924 const char *msgid
, ...))
926 #ifndef ANSI_PROTOTYPES
933 VA_START (ap
, msgid
);
935 #ifndef ANSI_PROTOTYPES
936 file
= va_arg (ap
, const char *);
937 line
= va_arg (ap
, int);
938 msgid
= va_arg (ap
, const char *);
941 v_pedwarn_with_file_and_line (file
, line
, msgid
, ap
);
945 /* Just apologize with MSGID. */
947 sorry
VPROTO((const char *msgid
, ...))
949 #ifndef ANSI_PROTOTYPES
954 VA_START (ap
, msgid
);
956 #ifndef ANSI_PROTOTYPES
957 msgid
= va_arg (ap
, const char *);
964 /* Called when the start of a function definition is parsed,
965 this function prints on stderr the name of the function. */
968 announce_function (decl
)
973 if (rtl_dump_and_exit
)
974 fprintf (stderr
, "%s ", IDENTIFIER_POINTER (DECL_NAME (decl
)));
977 if (doing_line_wrapping ())
979 (stderr
, " %s", (*decl_printable_name
) (decl
, 2));
981 fprintf (stderr
, " %s", (*decl_printable_name
) (decl
, 2));
984 need_error_newline
= 1;
985 last_error_function
= current_function_decl
;
989 /* The default function to print out name of current function that caused
993 default_print_error_function (file
)
996 if (last_error_function
!= current_function_decl
)
998 const char *prefix
= NULL
;
999 struct output_buffer buffer
;
1002 prefix
= build_message_string ("%s: ", file
);
1004 if (doing_line_wrapping ())
1005 init_output_buffer (&buffer
, prefix
, output_maximum_width
);
1009 fprintf (stderr
, "%s: ", file
);
1012 if (current_function_decl
== NULL
)
1014 if (doing_line_wrapping ())
1015 output_printf (&buffer
, "At top level:\n");
1017 notice ("At top level:\n");
1021 if (TREE_CODE (TREE_TYPE (current_function_decl
)) == METHOD_TYPE
)
1023 if (doing_line_wrapping ())
1025 (&buffer
, "In method `%s':\n",
1026 (*decl_printable_name
) (current_function_decl
, 2));
1028 notice ("In method `%s':\n",
1029 (*decl_printable_name
) (current_function_decl
, 2));
1033 if (doing_line_wrapping ())
1035 (&buffer
, "In function `%s':\n",
1036 (*decl_printable_name
) (current_function_decl
, 2));
1038 notice ("In function `%s':\n",
1039 (*decl_printable_name
) (current_function_decl
, 2));
1043 last_error_function
= current_function_decl
;
1045 if (doing_line_wrapping ())
1046 dump_output (&buffer
, stderr
);
1048 free ((char *)prefix
);
1052 /* Prints out, if necessary, the name of the current function
1053 that caused an error. Called from all error and warning functions.
1054 We ignore the FILE parameter, as it cannot be relied upon. */
1057 report_error_function (file
)
1058 const char *file ATTRIBUTE_UNUSED
;
1060 struct file_stack
*p
;
1062 if (need_error_newline
)
1064 fprintf (stderr
, "\n");
1065 need_error_newline
= 0;
1068 if (input_file_stack
&& input_file_stack
->next
!= 0
1069 && input_file_stack_tick
!= last_error_tick
)
1071 for (p
= input_file_stack
->next
; p
; p
= p
->next
)
1072 if (p
== input_file_stack
->next
)
1073 notice ("In file included from %s:%d", p
->name
, p
->line
);
1075 notice (",\n from %s:%d", p
->name
, p
->line
);
1076 fprintf (stderr
, ":\n");
1077 last_error_tick
= input_file_stack_tick
;
1080 (*print_error_function
) (input_filename
);
1084 error_with_file_and_line
VPROTO((const char *file
, int line
,
1085 const char *msgid
, ...))
1087 #ifndef ANSI_PROTOTYPES
1094 VA_START (ap
, msgid
);
1096 #ifndef ANSI_PROTOTYPES
1097 file
= va_arg (ap
, const char *);
1098 line
= va_arg (ap
, int);
1099 msgid
= va_arg (ap
, const char *);
1102 v_error_with_file_and_line (file
, line
, msgid
, ap
);
1107 error_with_decl
VPROTO((tree decl
, const char *msgid
, ...))
1109 #ifndef ANSI_PROTOTYPES
1115 VA_START (ap
, msgid
);
1117 #ifndef ANSI_PROTOTYPES
1118 decl
= va_arg (ap
, tree
);
1119 msgid
= va_arg (ap
, const char *);
1122 v_error_with_decl (decl
, msgid
, ap
);
1127 error_for_asm
VPROTO((rtx insn
, const char *msgid
, ...))
1129 #ifndef ANSI_PROTOTYPES
1135 VA_START (ap
, msgid
);
1137 #ifndef ANSI_PROTOTYPES
1138 insn
= va_arg (ap
, rtx
);
1139 msgid
= va_arg (ap
, const char *);
1142 v_error_for_asm (insn
, msgid
, ap
);
1147 error
VPROTO((const char *msgid
, ...))
1149 #ifndef ANSI_PROTOTYPES
1154 VA_START (ap
, msgid
);
1156 #ifndef ANSI_PROTOTYPES
1157 msgid
= va_arg (ap
, const char *);
1164 /* Set the function to call when a fatal error occurs. */
1167 set_fatal_function (f
)
1168 void (*f
) PROTO ((const char *, va_list));
1174 fatal
VPROTO((const char *msgid
, ...))
1176 #ifndef ANSI_PROTOTYPES
1181 VA_START (ap
, msgid
);
1183 #ifndef ANSI_PROTOTYPES
1184 msgid
= va_arg (ap
, const char *);
1192 _fatal_insn (msgid
, insn
, file
, line
, function
)
1197 const char *function
;
1199 error ("%s", msgid
);
1201 fancy_abort (file
, line
, function
);
1205 _fatal_insn_not_found (insn
, file
, line
, function
)
1209 const char *function
;
1211 if (INSN_CODE (insn
) < 0)
1212 _fatal_insn ("Unrecognizable insn:", insn
, file
, line
, function
);
1214 _fatal_insn ("Insn does not satisfy its constraints:",
1215 insn
, file
, line
, function
);
1219 warning_with_file_and_line
VPROTO((const char *file
, int line
,
1220 const char *msgid
, ...))
1222 #ifndef ANSI_PROTOTYPES
1229 VA_START (ap
, msgid
);
1231 #ifndef ANSI_PROTOTYPES
1232 file
= va_arg (ap
, const char *);
1233 line
= va_arg (ap
, int);
1234 msgid
= va_arg (ap
, const char *);
1237 v_warning_with_file_and_line (file
, line
, msgid
, ap
);
1242 warning_with_decl
VPROTO((tree decl
, const char *msgid
, ...))
1244 #ifndef ANSI_PROTOTYPES
1250 VA_START (ap
, msgid
);
1252 #ifndef ANSI_PROTOTYPES
1253 decl
= va_arg (ap
, tree
);
1254 msgid
= va_arg (ap
, const char *);
1257 v_warning_with_decl (decl
, msgid
, ap
);
1262 warning_for_asm
VPROTO((rtx insn
, const char *msgid
, ...))
1264 #ifndef ANSI_PROTOTYPES
1270 VA_START (ap
, msgid
);
1272 #ifndef ANSI_PROTOTYPES
1273 insn
= va_arg (ap
, rtx
);
1274 msgid
= va_arg (ap
, const char *);
1277 v_warning_for_asm (insn
, msgid
, ap
);
1282 warning
VPROTO((const char *msgid
, ...))
1284 #ifndef ANSI_PROTOTYPES
1289 VA_START (ap
, msgid
);
1291 #ifndef ANSI_PROTOTYPES
1292 msgid
= va_arg (ap
, const char *);
1295 vwarning (msgid
, ap
);