1 /* Top level of GNU C compiler
2 Copyright (C) 1999, 2000 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 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
PARAMS ((void));
55 static void init_output_buffer
PARAMS ((struct output_buffer
*, char *, int));
56 static char *get_output_prefix
PARAMS ((const struct output_buffer
*));
57 static int output_space_left
PARAMS ((const struct output_buffer
*));
58 static void emit_output_prefix
PARAMS ((struct output_buffer
*));
59 static void output_newline
PARAMS ((struct output_buffer
*));
60 static void output_append
PARAMS ((struct output_buffer
*, const char *,
62 static void output_puts
PARAMS ((struct output_buffer
*, const char *));
63 static void dump_output
PARAMS ((struct output_buffer
*, FILE *));
64 static char *vbuild_message_string
PARAMS ((const char *, va_list));
65 static char *build_message_string
PARAMS ((const char *, ...))
67 static char *build_location_prefix
PARAMS ((const char *, int, int));
68 static void voutput_notice
PARAMS ((struct output_buffer
*, const char *,
70 static void output_printf
PARAMS ((struct output_buffer
*, const char *, ...))
72 static void line_wrapper_printf
PARAMS ((FILE *, const char *, ...))
74 static void vline_wrapper_message_with_location
PARAMS ((const char *, int,
77 static void notice
PARAMS ((const char *s
, ...)) ATTRIBUTE_PRINTF_1
;
78 static void v_message_with_file_and_line
PARAMS ((const char *, int, int,
79 const char *, va_list));
80 static void v_message_with_decl
PARAMS ((tree
, int, const char *, va_list));
81 static void file_and_line_for_asm
PARAMS ((rtx
, char **, int *));
82 static void v_error_with_file_and_line
PARAMS ((const char *, int,
83 const char *, va_list));
84 static void v_error_with_decl
PARAMS ((tree
, const char *, va_list));
85 static void v_error_for_asm
PARAMS ((rtx
, const char *, va_list));
86 static void verror
PARAMS ((const char *, va_list));
87 static void vfatal
PARAMS ((const char *, va_list)) ATTRIBUTE_NORETURN
;
88 static void v_warning_with_file_and_line
PARAMS ((const char *, int,
89 const char *, va_list));
90 static void v_warning_with_decl
PARAMS ((tree
, const char *, va_list));
91 static void v_warning_for_asm
PARAMS ((rtx
, const char *, va_list));
92 static void vwarning
PARAMS ((const char *, va_list));
93 static void vpedwarn
PARAMS ((const char *, va_list));
94 static void v_pedwarn_with_decl
PARAMS ((tree
, const char *, va_list));
95 static void v_pedwarn_with_file_and_line
PARAMS ((const char *, int,
96 const char *, va_list));
97 static void vsorry
PARAMS ((const char *, va_list));
98 static void report_file_and_line
PARAMS ((const char *, int, int));
99 static void vnotice
PARAMS ((FILE *, const char *, va_list));
102 extern int rtl_dump_and_exit
;
103 extern int inhibit_warnings
;
104 extern int warnings_are_errors
;
105 extern int warningcount
;
106 extern int errorcount
;
108 static int need_error_newline
;
110 /* Function of last error message;
111 more generally, function such that if next error message is in it
112 then we don't have to mention the function name. */
113 static tree last_error_function
= NULL
;
115 /* Used to detect when input_file_stack has changed since last described. */
116 static int last_error_tick
;
118 /* Called by report_error_function to print out function name.
119 * Default may be overridden by language front-ends. */
121 void (*print_error_function
) PARAMS ((const char *)) =
122 default_print_error_function
;
124 /* Maximum characters per line in automatic line wrapping mode.
125 Zero means don't wrap lines. */
127 static int output_maximum_width
= 0;
129 /* Predicate. Return 1 if we're in automatic line wrapping mode. */
132 doing_line_wrapping ()
134 return output_maximum_width
> 0;
137 /* Set Maximum characters per line in automatic line wrapping mode. */
140 set_message_length (n
)
143 output_maximum_width
= n
;
146 /* Construct an output BUFFER with PREFIX and of MAX_LENGTH characters
150 init_output_buffer (buffer
, prefix
, max_length
)
151 struct output_buffer
*buffer
;
155 int prefix_length
= prefix
== 0 ? 0 : strlen (prefix
);
157 obstack_init (&buffer
->obstack
);
158 buffer
->prefix
= prefix
;
159 buffer
->line_length
= 0;
160 /* If the prefix is ridiculously too long, output at least
162 if (max_length
- prefix_length
< 32)
163 buffer
->max_length
= max_length
+ 32;
165 buffer
->max_length
= max_length
;
168 /* Return BUFFER's prefix. */
171 get_output_prefix (buffer
)
172 const struct output_buffer
*buffer
;
174 return buffer
->prefix
;
177 /* Return the amount of characters BUFFER can accept to
181 output_space_left (buffer
)
182 const struct output_buffer
*buffer
;
184 return buffer
->max_length
- buffer
->line_length
;
187 /* Dump BUFFER's prefix. */
190 emit_output_prefix (buffer
)
191 struct output_buffer
*buffer
;
195 buffer
->line_length
= strlen (buffer
->prefix
);
196 obstack_grow (&buffer
->obstack
, buffer
->prefix
, buffer
->line_length
);
200 /* Have BUFFER start a new line. */
203 output_newline (buffer
)
204 struct output_buffer
*buffer
;
206 obstack_1grow (&buffer
->obstack
, '\n');
207 buffer
->line_length
= 0;
210 /* Append a string deliminated by START and END to BUFFER. No wrapping is
211 done. The caller must ensure that it is safe to do so. */
214 output_append (buffer
, start
, end
)
215 struct output_buffer
*buffer
;
221 /* Emit prefix and skip whitespace if we're starting a new line. */
222 if (buffer
->line_length
== 0)
224 emit_output_prefix (buffer
);
225 while (start
!= end
&& *start
== ' ')
229 obstack_grow (&buffer
->obstack
, start
, n
);
230 buffer
->line_length
+= n
;
233 /* Wrap a STRing into BUFFER. */
236 output_puts (buffer
, str
)
237 struct output_buffer
*buffer
;
244 while (*p
&& *p
!= ' ' && *p
!= '\n')
247 if (p
- str
< output_space_left (buffer
))
248 output_append (buffer
, str
, p
);
251 output_newline (buffer
);
252 output_append (buffer
, str
, p
);
255 while (*p
&& *p
== '\n')
257 output_newline (buffer
);
265 /* Dump the content of BUFFER into FILE. */
268 dump_output (buffer
, file
)
269 struct output_buffer
*buffer
;
274 obstack_1grow (&buffer
->obstack
, '\0');
275 text
= obstack_finish (&buffer
->obstack
);
277 obstack_free (&buffer
->obstack
, text
);
278 buffer
->line_length
= 0;
282 vbuild_message_string (msgid
, ap
)
288 vasprintf (&str
, msgid
, ap
);
292 /* Return a malloc'd string containing MSGID formatted a la
293 printf. The caller is reponsible for freeing the memory. */
296 build_message_string
VPARAMS ((const char *msgid
, ...))
298 #ifndef ANSI_PROTOTYPES
304 VA_START (ap
, msgid
);
306 #ifndef ANSI_PROTOTYPES
307 msgid
= va_arg (ap
, const char *);
310 str
= vbuild_message_string (msgid
, ap
);
318 /* Return a malloc'd string describing a location. The caller is
319 responsible for freeing the memory. */
322 build_location_prefix (file
, line
, warn
)
330 return build_message_string ("%s:%d: warning: ", file
, line
);
332 return build_message_string ("%s:%d: ", file
, line
);
337 return build_message_string ("%s: warning: ", progname
);
339 return build_message_string ("%s: ", progname
);
343 /* Format a MESSAGE into BUFFER. Automatically wrap lines. */
346 voutput_notice (buffer
, msgid
, ap
)
347 struct output_buffer
*buffer
;
351 char *message
= vbuild_message_string (msgid
, ap
);
353 output_puts (buffer
, message
);
358 /* Format a message into BUFFER a la printf. */
361 output_printf
VPARAMS ((struct output_buffer
*buffer
, const char *msgid
, ...))
363 #ifndef ANSI_PROTOTYPES
364 struct output_buffer
*buffer
;
369 VA_START (ap
, msgid
);
371 #ifndef ANSI_PROTOTYPES
372 buffer
= va_arg (ap
, struct output_buffer
*);
373 msgid
= va_arg (ap
, const char *);
376 voutput_notice (buffer
, msgid
, ap
);
381 /* Format a MESSAGE into FILE. Do line wrapping, starting new lines
385 line_wrapper_printf
VPARAMS ((FILE *file
, const char *msgid
, ...))
387 #ifndef ANSI_PROTOTYPES
391 struct output_buffer buffer
;
394 VA_START (ap
, msgid
);
396 #ifndef ANSI_PROTOTYPES
397 file
= va_arg (ap
, FILE *);
398 msgid
= va_arg (ap
, const char *);
401 init_output_buffer (&buffer
, NULL
, output_maximum_width
);
402 voutput_notice (&buffer
, msgid
, ap
);
403 dump_output (&buffer
, file
);
410 vline_wrapper_message_with_location (file
, line
, warn
, msgid
, ap
)
417 struct output_buffer buffer
;
420 (&buffer
, build_location_prefix (file
, line
, warn
), output_maximum_width
);
421 voutput_notice (&buffer
, msgid
, ap
);
422 dump_output (&buffer
, stderr
);
423 free ((char*)get_output_prefix (&buffer
));
424 fputc ('\n', stderr
);
428 /* Print the message MSGID in FILE. */
431 vnotice (file
, msgid
, ap
)
436 vfprintf (file
, _(msgid
), ap
);
439 /* Print MSGID on stderr. */
442 notice
VPARAMS ((const char *msgid
, ...))
444 #ifndef ANSI_PROTOTYPES
449 VA_START (ap
, msgid
);
451 #ifndef ANSI_PROTOTYPES
452 msgid
= va_arg (ap
, char *);
455 vnotice (stderr
, msgid
, ap
);
459 /* Report FILE and LINE (or program name), and optionally just WARN. */
462 report_file_and_line (file
, line
, warn
)
468 fprintf (stderr
, "%s:%d: ", file
, line
);
470 fprintf (stderr
, "%s: ", progname
);
473 notice ("warning: ");
476 /* Print a message relevant to line LINE of file FILE. */
479 v_message_with_file_and_line (file
, line
, warn
, msgid
, ap
)
486 report_file_and_line (file
, line
, warn
);
487 vnotice (stderr
, msgid
, ap
);
488 fputc ('\n', stderr
);
491 /* Print a message relevant to the given DECL. */
494 v_message_with_decl (decl
, warn
, msgid
, ap
)
501 struct output_buffer buffer
;
503 if (doing_line_wrapping ())
506 build_location_prefix (DECL_SOURCE_FILE (decl
),
507 DECL_SOURCE_LINE (decl
), warn
),
508 output_maximum_width
);
510 report_file_and_line (DECL_SOURCE_FILE (decl
),
511 DECL_SOURCE_LINE (decl
), warn
);
513 /* Do magic to get around lack of varargs support for insertion
514 of arguments into existing list. We know that the decl is first;
515 we ass_u_me that it will be printed with "%s". */
517 for (p
= _(msgid
); *p
; ++p
)
523 else if (*(p
+ 1) != 's')
530 if (p
> _(msgid
)) /* Print the left-hand substring. */
532 if (doing_line_wrapping ())
533 output_printf (&buffer
, "%.*s", (int)(p
- _(msgid
)), _(msgid
));
535 fprintf (stderr
, "%.*s", (int)(p
- _(msgid
)), _(msgid
));
538 if (*p
== '%') /* Print the name. */
540 const char *n
= (DECL_NAME (decl
)
541 ? (*decl_printable_name
) (decl
, 2)
543 if (doing_line_wrapping ())
544 output_puts (&buffer
, n
);
550 if (ISALPHA (*(p
- 1) & 0xFF))
555 if (*p
) /* Print the rest of the message. */
557 if (doing_line_wrapping ())
558 voutput_notice (&buffer
, p
, ap
);
560 vfprintf (stderr
, p
, ap
);
563 if (doing_line_wrapping())
565 dump_output (&buffer
, stderr
);
566 free ((char *)get_output_prefix (&buffer
));
569 fputc ('\n', stderr
);
572 /* Figure file and line of the given INSN. */
575 file_and_line_for_asm (insn
, pfile
, pline
)
580 rtx body
= PATTERN (insn
);
583 /* Find the (or one of the) ASM_OPERANDS in the insn. */
584 if (GET_CODE (body
) == SET
&& GET_CODE (SET_SRC (body
)) == ASM_OPERANDS
)
585 asmop
= SET_SRC (body
);
586 else if (GET_CODE (body
) == ASM_OPERANDS
)
588 else if (GET_CODE (body
) == PARALLEL
589 && GET_CODE (XVECEXP (body
, 0, 0)) == SET
)
590 asmop
= SET_SRC (XVECEXP (body
, 0, 0));
591 else if (GET_CODE (body
) == PARALLEL
592 && GET_CODE (XVECEXP (body
, 0, 0)) == ASM_OPERANDS
)
593 asmop
= XVECEXP (body
, 0, 0);
599 *pfile
= ASM_OPERANDS_SOURCE_FILE (asmop
);
600 *pline
= ASM_OPERANDS_SOURCE_LINE (asmop
);
604 *pfile
= input_filename
;
609 /* Report an error at line LINE of file FILE. */
612 v_error_with_file_and_line (file
, line
, msgid
, ap
)
619 report_error_function (file
);
620 if (doing_line_wrapping ())
621 vline_wrapper_message_with_location (file
, line
, 0, msgid
, ap
);
623 v_message_with_file_and_line (file
, line
, 0, msgid
, ap
);
626 /* Report an error at the declaration DECL.
627 MSGID is a format string which uses %s to substitute the declaration
628 name; subsequent substitutions are a la printf. */
631 v_error_with_decl (decl
, msgid
, ap
)
637 report_error_function (DECL_SOURCE_FILE (decl
));
638 v_message_with_decl (decl
, 0, msgid
, ap
);
642 /* Report an error at the line number of the insn INSN.
643 This is used only when INSN is an `asm' with operands,
644 and each ASM_OPERANDS records its own source file and line. */
647 v_error_for_asm (insn
, msgid
, ap
)
656 file_and_line_for_asm (insn
, &file
, &line
);
657 report_error_function (file
);
658 v_message_with_file_and_line (file
, line
, 0, msgid
, ap
);
662 /* Report an error at the current line number. */
669 v_error_with_file_and_line (input_filename
, lineno
, msgid
, ap
);
673 /* Report a fatal error at the current line number. Allow a front end to
674 intercept the message. */
676 static void (*fatal_function
) PARAMS ((const char *, va_list));
683 if (fatal_function
!= 0)
684 (*fatal_function
) (_(msgid
), ap
);
687 exit (FATAL_EXIT_CODE
);
690 /* Report a warning at line LINE of file FILE. */
693 v_warning_with_file_and_line (file
, line
, msgid
, ap
)
701 report_error_function (file
);
702 if (doing_line_wrapping ())
703 vline_wrapper_message_with_location (file
, line
, 1, msgid
, ap
);
705 v_message_with_file_and_line (file
, line
, 1, msgid
, ap
);
710 /* Report a warning at the declaration DECL.
711 MSGID is a format string which uses %s to substitute the declaration
712 name; subsequent substitutions are a la printf. */
715 v_warning_with_decl (decl
, msgid
, ap
)
722 report_error_function (DECL_SOURCE_FILE (decl
));
723 v_message_with_decl (decl
, 1, msgid
, ap
);
728 /* Report a warning at the line number of the insn INSN.
729 This is used only when INSN is an `asm' with operands,
730 and each ASM_OPERANDS records its own source file and line. */
733 v_warning_for_asm (insn
, msgid
, ap
)
743 file_and_line_for_asm (insn
, &file
, &line
);
744 report_error_function (file
);
745 v_message_with_file_and_line (file
, line
, 1, msgid
, ap
);
750 /* Report a warning at the current line number. */
757 v_warning_with_file_and_line (input_filename
, lineno
, msgid
, ap
);
760 /* These functions issue either warnings or errors depending on
768 if (flag_pedantic_errors
)
771 vwarning (msgid
, ap
);
776 v_pedwarn_with_decl (decl
, msgid
, ap
)
781 /* We don't want -pedantic-errors to cause the compilation to fail from
782 "errors" in system header files. Sometimes fixincludes can't fix what's
783 broken (eg: unsigned char bitfields - fixing it may change the alignment
784 which will cause programs to mysteriously fail because the C library
785 or kernel uses the original layout). There's no point in issuing a
786 warning either, it's just unnecessary noise. */
788 if (! DECL_IN_SYSTEM_HEADER (decl
))
790 if (flag_pedantic_errors
)
791 v_error_with_decl (decl
, msgid
, ap
);
793 v_warning_with_decl (decl
, msgid
, ap
);
799 v_pedwarn_with_file_and_line (file
, line
, msgid
, ap
)
805 if (flag_pedantic_errors
)
806 v_error_with_file_and_line (file
, line
, msgid
, ap
);
808 v_warning_with_file_and_line (file
, line
, msgid
, ap
);
812 /* Apologize for not implementing some feature. */
821 fprintf (stderr
, "%s:%d: ", input_filename
, lineno
);
823 fprintf (stderr
, "%s: ", progname
);
824 notice ("sorry, not implemented: ");
825 vnotice (stderr
, msgid
, ap
);
826 fputc ('\n', stderr
);
830 /* Count an error or warning. Return 1 if the message should be printed. */
833 count_error (warningp
)
836 if (warningp
&& inhibit_warnings
)
839 if (warningp
&& !warnings_are_errors
)
843 static int warning_message
= 0;
845 if (warningp
&& !warning_message
)
847 notice ("%s: warnings being treated as errors\n", progname
);
856 /* Print a diagnistic MSGID on FILE. */
858 fnotice
VPARAMS ((FILE *file
, const char *msgid
, ...))
860 #ifndef ANSI_PROTOTYPES
866 VA_START (ap
, msgid
);
868 #ifndef ANSI_PROTOTYPES
869 file
= va_arg (ap
, FILE *);
870 msgid
= va_arg (ap
, const char *);
873 vnotice (file
, msgid
, ap
);
878 /* Print a fatal error message. NAME is the text.
879 Also include a system error message based on `errno'. */
882 pfatal_with_name (name
)
885 fprintf (stderr
, "%s: ", progname
);
887 exit (FATAL_EXIT_CODE
);
891 fatal_io_error (name
)
894 notice ("%s: %s: I/O error\n", progname
, name
);
895 exit (FATAL_EXIT_CODE
);
898 /* Issue a pedantic warning MSGID. */
900 pedwarn
VPARAMS ((const char *msgid
, ...))
902 #ifndef ANSI_PROTOTYPES
907 VA_START (ap
, msgid
);
909 #ifndef ANSI_PROTOTYPES
910 msgid
= va_arg (ap
, const char *);
913 vpedwarn (msgid
, ap
);
917 /* Issue a pedantic waring about DECL. */
919 pedwarn_with_decl
VPARAMS ((tree decl
, const char *msgid
, ...))
921 #ifndef ANSI_PROTOTYPES
927 VA_START (ap
, msgid
);
929 #ifndef ANSI_PROTOTYPES
930 decl
= va_arg (ap
, tree
);
931 msgid
= va_arg (ap
, const char *);
934 v_pedwarn_with_decl (decl
, msgid
, ap
);
938 /* Same as above but within the context FILE and LINE. */
940 pedwarn_with_file_and_line
VPARAMS ((const char *file
, int line
,
941 const char *msgid
, ...))
943 #ifndef ANSI_PROTOTYPES
950 VA_START (ap
, msgid
);
952 #ifndef ANSI_PROTOTYPES
953 file
= va_arg (ap
, const char *);
954 line
= va_arg (ap
, int);
955 msgid
= va_arg (ap
, const char *);
958 v_pedwarn_with_file_and_line (file
, line
, msgid
, ap
);
962 /* Just apologize with MSGID. */
964 sorry
VPARAMS ((const char *msgid
, ...))
966 #ifndef ANSI_PROTOTYPES
971 VA_START (ap
, msgid
);
973 #ifndef ANSI_PROTOTYPES
974 msgid
= va_arg (ap
, const char *);
981 /* Called when the start of a function definition is parsed,
982 this function prints on stderr the name of the function. */
985 announce_function (decl
)
990 if (rtl_dump_and_exit
)
991 fprintf (stderr
, "%s ", IDENTIFIER_POINTER (DECL_NAME (decl
)));
994 if (doing_line_wrapping ())
996 (stderr
, " %s", (*decl_printable_name
) (decl
, 2));
998 fprintf (stderr
, " %s", (*decl_printable_name
) (decl
, 2));
1001 need_error_newline
= 1;
1002 last_error_function
= current_function_decl
;
1006 /* The default function to print out name of current function that caused
1010 default_print_error_function (file
)
1013 if (last_error_function
!= current_function_decl
)
1015 char *prefix
= NULL
;
1016 struct output_buffer buffer
;
1019 prefix
= build_message_string ("%s: ", file
);
1021 if (doing_line_wrapping ())
1022 init_output_buffer (&buffer
, prefix
, output_maximum_width
);
1026 fprintf (stderr
, "%s: ", file
);
1029 if (current_function_decl
== NULL
)
1031 if (doing_line_wrapping ())
1032 output_printf (&buffer
, "At top level:\n");
1034 notice ("At top level:\n");
1038 if (TREE_CODE (TREE_TYPE (current_function_decl
)) == METHOD_TYPE
)
1040 if (doing_line_wrapping ())
1042 (&buffer
, "In method `%s':\n",
1043 (*decl_printable_name
) (current_function_decl
, 2));
1045 notice ("In method `%s':\n",
1046 (*decl_printable_name
) (current_function_decl
, 2));
1050 if (doing_line_wrapping ())
1052 (&buffer
, "In function `%s':\n",
1053 (*decl_printable_name
) (current_function_decl
, 2));
1055 notice ("In function `%s':\n",
1056 (*decl_printable_name
) (current_function_decl
, 2));
1060 last_error_function
= current_function_decl
;
1062 if (doing_line_wrapping ())
1063 dump_output (&buffer
, stderr
);
1069 /* Prints out, if necessary, the name of the current function
1070 that caused an error. Called from all error and warning functions.
1071 We ignore the FILE parameter, as it cannot be relied upon. */
1074 report_error_function (file
)
1075 const char *file ATTRIBUTE_UNUSED
;
1077 struct file_stack
*p
;
1079 if (need_error_newline
)
1081 fprintf (stderr
, "\n");
1082 need_error_newline
= 0;
1085 if (input_file_stack
&& input_file_stack
->next
!= 0
1086 && input_file_stack_tick
!= last_error_tick
)
1088 for (p
= input_file_stack
->next
; p
; p
= p
->next
)
1089 if (p
== input_file_stack
->next
)
1090 notice ("In file included from %s:%d", p
->name
, p
->line
);
1092 notice (",\n from %s:%d", p
->name
, p
->line
);
1093 fprintf (stderr
, ":\n");
1094 last_error_tick
= input_file_stack_tick
;
1097 (*print_error_function
) (input_filename
);
1101 error_with_file_and_line
VPARAMS ((const char *file
, int line
,
1102 const char *msgid
, ...))
1104 #ifndef ANSI_PROTOTYPES
1111 VA_START (ap
, msgid
);
1113 #ifndef ANSI_PROTOTYPES
1114 file
= va_arg (ap
, const char *);
1115 line
= va_arg (ap
, int);
1116 msgid
= va_arg (ap
, const char *);
1119 v_error_with_file_and_line (file
, line
, msgid
, ap
);
1124 error_with_decl
VPARAMS ((tree decl
, const char *msgid
, ...))
1126 #ifndef ANSI_PROTOTYPES
1132 VA_START (ap
, msgid
);
1134 #ifndef ANSI_PROTOTYPES
1135 decl
= va_arg (ap
, tree
);
1136 msgid
= va_arg (ap
, const char *);
1139 v_error_with_decl (decl
, msgid
, ap
);
1144 error_for_asm
VPARAMS ((rtx insn
, const char *msgid
, ...))
1146 #ifndef ANSI_PROTOTYPES
1152 VA_START (ap
, msgid
);
1154 #ifndef ANSI_PROTOTYPES
1155 insn
= va_arg (ap
, rtx
);
1156 msgid
= va_arg (ap
, const char *);
1159 v_error_for_asm (insn
, msgid
, ap
);
1164 error
VPARAMS ((const char *msgid
, ...))
1166 #ifndef ANSI_PROTOTYPES
1171 VA_START (ap
, msgid
);
1173 #ifndef ANSI_PROTOTYPES
1174 msgid
= va_arg (ap
, const char *);
1181 /* Set the function to call when a fatal error occurs. */
1184 set_fatal_function (f
)
1185 void (*f
) PARAMS ((const char *, va_list));
1191 fatal
VPARAMS ((const char *msgid
, ...))
1193 #ifndef ANSI_PROTOTYPES
1198 VA_START (ap
, msgid
);
1200 #ifndef ANSI_PROTOTYPES
1201 msgid
= va_arg (ap
, const char *);
1209 _fatal_insn (msgid
, insn
, file
, line
, function
)
1214 const char *function
;
1216 error ("%s", msgid
);
1218 fancy_abort (file
, line
, function
);
1222 _fatal_insn_not_found (insn
, file
, line
, function
)
1226 const char *function
;
1228 if (INSN_CODE (insn
) < 0)
1229 _fatal_insn ("Unrecognizable insn:", insn
, file
, line
, function
);
1231 _fatal_insn ("Insn does not satisfy its constraints:",
1232 insn
, file
, line
, function
);
1236 warning_with_file_and_line
VPARAMS ((const char *file
, int line
,
1237 const char *msgid
, ...))
1239 #ifndef ANSI_PROTOTYPES
1246 VA_START (ap
, msgid
);
1248 #ifndef ANSI_PROTOTYPES
1249 file
= va_arg (ap
, const char *);
1250 line
= va_arg (ap
, int);
1251 msgid
= va_arg (ap
, const char *);
1254 v_warning_with_file_and_line (file
, line
, msgid
, ap
);
1259 warning_with_decl
VPARAMS ((tree decl
, const char *msgid
, ...))
1261 #ifndef ANSI_PROTOTYPES
1267 VA_START (ap
, msgid
);
1269 #ifndef ANSI_PROTOTYPES
1270 decl
= va_arg (ap
, tree
);
1271 msgid
= va_arg (ap
, const char *);
1274 v_warning_with_decl (decl
, msgid
, ap
);
1279 warning_for_asm
VPARAMS ((rtx insn
, const char *msgid
, ...))
1281 #ifndef ANSI_PROTOTYPES
1287 VA_START (ap
, msgid
);
1289 #ifndef ANSI_PROTOTYPES
1290 insn
= va_arg (ap
, rtx
);
1291 msgid
= va_arg (ap
, const char *);
1294 v_warning_for_asm (insn
, msgid
, ap
);
1299 warning
VPARAMS ((const char *msgid
, ...))
1301 #ifndef ANSI_PROTOTYPES
1306 VA_START (ap
, msgid
);
1308 #ifndef ANSI_PROTOTYPES
1309 msgid
= va_arg (ap
, const char *);
1312 vwarning (msgid
, ap
);