OSDN Git Service

2000-07-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
[pf3gnuchains/gcc-fork.git] / gcc / diagnostic.c
1 /* Language-independent diagnostic subroutines for the GNU C compiler
2    Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3    Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22
23 /* This file implements the language independant aspect of diagnostic
24    message module.  */
25
26 #include "config.h"
27 #undef FLOAT /* This is for hpux. They should change hpux.  */
28 #undef FFS  /* Some systems define this in param.h.  */
29 #include "system.h"
30
31 #include "tree.h"
32 #include "rtl.h"
33 #include "tm_p.h"
34 #include "flags.h"
35 #include "input.h"
36 #include "insn-attr.h"
37 #include "insn-codes.h"
38 #include "insn-config.h"
39 #include "toplev.h"
40 #include "intl.h"
41 #include "diagnostic.h"
42
43 #define obstack_chunk_alloc xmalloc
44 #define obstack_chunk_free  free
45
46 #define output_formatted_integer(BUFFER, FORMAT, INTEGER) \
47   do {                                                    \
48     sprintf (digit_buffer, FORMAT, INTEGER);              \
49     output_add_string (BUFFER, digit_buffer);             \
50   } while (0)
51
52 #define output_text_length(BUFFER) (BUFFER)->line_length
53 #define is_starting_newline(BUFFER) (output_text_length (BUFFER) == 0)
54 #define output_prefix(BUFFER) (BUFFER)->state.prefix
55 #define line_wrap_cutoff(BUFFER) (BUFFER)->state.maximum_length
56 #define ideal_line_wrap_cutoff(BUFFER) (BUFFER)->state.ideal_maximum_length
57 #define prefix_was_emitted_for(BUFFER) (BUFFER)->state.emitted_prefix_p
58 #define prefixing_policy(BUFFER) (BUFFER)->state.prefixing_rule
59 #define output_buffer_ptr_to_format_args(BUFFER) (BUFFER)->state.format_args
60
61 #define diagnostic_args output_buffer_ptr_to_format_args (diagnostic_buffer)
62 #define diagnostic_msg output_buffer_text_cursor (diagnostic_buffer)
63
64 /* Prototypes. */
65 static void finish_diagnostic PARAMS ((void));
66 static void output_do_verbatim PARAMS ((output_buffer *,
67                                         const char *, va_list *));
68 static void output_to_stream PARAMS ((output_buffer *, FILE *));
69 static void output_format PARAMS ((output_buffer *));
70
71 static char *vbuild_message_string PARAMS ((const char *, va_list));
72 static char *build_message_string PARAMS ((const char *, ...))
73      ATTRIBUTE_PRINTF_1;
74 static char *context_as_prefix PARAMS ((const char *, int, int));
75 static void output_do_printf PARAMS ((output_buffer *, const char *));
76 static void format_with_decl PARAMS ((output_buffer *, tree));
77 static void file_and_line_for_asm PARAMS ((rtx, const char **, int *));
78 static void diagnostic_for_asm PARAMS ((rtx, const char *, va_list *, int));
79 static void diagnostic_for_decl PARAMS ((tree, const char *, va_list *, int));
80 static void vnotice PARAMS ((FILE *, const char *, va_list));
81 static void set_real_maximum_length PARAMS ((output_buffer *));
82                                           
83 static void output_unsigned_decimal PARAMS ((output_buffer *, unsigned int));
84 static void output_long_decimal PARAMS ((output_buffer *, long int));
85 static void output_long_unsigned_decimal PARAMS ((output_buffer *,
86                                                   long unsigned int));
87 static void output_octal PARAMS ((output_buffer *, unsigned int));
88 static void output_long_octal PARAMS ((output_buffer *, unsigned long int));
89 static void output_hexadecimal PARAMS ((output_buffer *, unsigned int));
90 static void output_long_hexadecimal PARAMS ((output_buffer *,
91                                              unsigned long int));
92 static void output_append_r PARAMS ((output_buffer *, const char *, int));
93 static void wrap_text PARAMS ((output_buffer *, const char *, const char *));
94 static void maybe_wrap_text PARAMS ((output_buffer *, const char *,
95                                      const char *));
96 static void clear_text_info PARAMS ((output_buffer *));
97 static void clear_diagnostic_info PARAMS ((output_buffer *));
98
99 static void error_recursion PARAMS ((void)) ATTRIBUTE_NORETURN;
100 static const char *trim_filename PARAMS ((const char *));
101
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;
107
108 /* Front-end specific tree formatter, if non-NULL.  */
109 printer_fn lang_printer = NULL;
110
111 /* This must be large enough to hold any printed integer or
112    floating-point value.  */
113 static char digit_buffer[128];
114
115 /* An output_buffer surrogate for stderr.  */
116 static output_buffer global_output_buffer;
117 output_buffer *diagnostic_buffer = &global_output_buffer;
118
119 static int need_error_newline;
120
121 /* Function of last error message;
122    more generally, function such that if next error message is in it
123    then we don't have to mention the function name.  */
124 static tree last_error_function = NULL;
125
126 /* Used to detect when input_file_stack has changed since last described.  */
127 static int last_error_tick;
128
129 /* Called by report_error_function to print out function name.
130  * Default may be overridden by language front-ends.  */
131
132 void (*print_error_function) PARAMS ((const char *)) =
133   default_print_error_function;
134
135 /* Maximum characters per line in automatic line wrapping mode.
136    Zero means don't wrap lines. */
137
138 int diagnostic_message_length_per_line;
139
140 /* Used to control every diagnostic message formatting.  Front-ends should
141    call set_message_prefixing_rule to set up their politics.  */
142 static int current_prefixing_rule;
143
144 /* Prevent recursion into the error handler.  */
145 static int diagnostic_lock;
146
147 \f
148 /* Initialize the diagnostic message outputting machinery.  */
149
150 void
151 initialize_diagnostics ()
152 {
153   /* By default, we don't line-wrap messages.  */
154   diagnostic_message_length_per_line = 0;
155   set_message_prefixing_rule (DIAGNOSTICS_SHOW_PREFIX_ONCE);
156   /* Proceed to actual initialization.  */
157   default_initialize_buffer (diagnostic_buffer);
158 }
159
160 void
161 set_message_prefixing_rule (rule)
162      int rule;
163 {
164   current_prefixing_rule = rule;
165 }
166
167 /* Returns true if BUFFER is in line-wrappind mode.  */
168 int
169 output_is_line_wrapping (buffer)
170      output_buffer *buffer;
171 {
172   return ideal_line_wrap_cutoff (buffer) > 0;
173 }
174
175 /* Return BUFFER's prefix.  */
176 const char *
177 output_get_prefix (buffer)
178      const output_buffer *buffer;
179 {
180   return output_prefix (buffer);
181 }
182
183 /* Subroutine of output_set_maximum_length.  Set up BUFFER's
184    internal maximum characters per line.  */
185 static void
186 set_real_maximum_length (buffer)
187      output_buffer *buffer;
188 {
189   /* If we're told not to wrap lines then do the obvious thing.  */
190   if (! output_is_line_wrapping (buffer))
191     line_wrap_cutoff (buffer) = ideal_line_wrap_cutoff (buffer);
192   else
193     {
194       int prefix_length =
195         output_prefix (buffer) ? strlen (output_prefix (buffer)) : 0;
196       /* If the prefix is ridiculously too long, output at least
197          32 characters.  */
198       if (ideal_line_wrap_cutoff (buffer) - prefix_length < 32)
199         line_wrap_cutoff (buffer) = ideal_line_wrap_cutoff (buffer) + 32;
200       else
201         line_wrap_cutoff (buffer) = ideal_line_wrap_cutoff (buffer);
202     }
203 }
204
205 /* Sets the number of maximum characters per line BUFFER can output
206    in line-wrapping mode.  A LENGTH value 0 suppresses line-wrapping.  */
207 void
208 output_set_maximum_length (buffer, length)
209      output_buffer *buffer;
210      int length;
211 {
212  ideal_line_wrap_cutoff (buffer) = length;
213   set_real_maximum_length (buffer);
214 }
215
216 /* Sets BUFFER's PREFIX.  */
217 void
218 output_set_prefix (buffer, prefix)
219      output_buffer *buffer;
220      const char *prefix;
221 {
222   output_prefix (buffer) = prefix;
223   set_real_maximum_length (buffer);
224   prefix_was_emitted_for (buffer) = 0;
225 }
226
227 /* Free BUFFER's prefix, a previously malloc()'d string.  */
228
229 void
230 output_destroy_prefix (buffer)
231      output_buffer *buffer;
232 {
233   if (output_prefix (buffer) != NULL)
234     {
235       free ((char *) output_prefix (buffer));
236       output_prefix (buffer) = NULL;
237     }
238 }
239
240 /* Zero out any text output so far in BUFFER.  */
241 static void
242 clear_text_info (buffer)
243      output_buffer *buffer;
244 {
245   obstack_free (&buffer->obstack, obstack_base (&buffer->obstack));
246   output_text_length (buffer) = 0;
247 }
248
249 /* Zero out any diagnostic data used so far by BUFFER.  */
250 static void
251 clear_diagnostic_info (buffer)
252      output_buffer *buffer;
253 {
254   output_buffer_text_cursor (buffer) = NULL;
255   output_buffer_ptr_to_format_args (buffer) = NULL;
256   prefix_was_emitted_for (buffer) = 0;
257 }
258
259 /* Construct an output BUFFER with PREFIX and of MAXIMUM_LENGTH
260    characters per line.  */
261 void
262 init_output_buffer (buffer, prefix, maximum_length)
263      output_buffer *buffer;
264      const char *prefix;
265      int maximum_length;
266 {
267   obstack_init (&buffer->obstack);
268   ideal_line_wrap_cutoff (buffer) = maximum_length;
269   prefixing_policy (buffer) = current_prefixing_rule;
270   output_set_prefix (buffer, prefix);
271   output_text_length (buffer) = 0;
272   clear_diagnostic_info (buffer);  
273 }
274
275 /* Initialize BUFFER with a NULL prefix and current diagnostic message
276    length cutoff.  */
277 void
278 default_initialize_buffer (buffer)
279      output_buffer *buffer;
280 {
281   init_output_buffer (buffer, NULL, diagnostic_message_length_per_line);
282 }
283
284 /* Recompute diagnostic_buffer's attributes to reflect any change
285    in diagnostic formatting global options.  */
286 void
287 reshape_diagnostic_buffer ()
288 {
289   ideal_line_wrap_cutoff (diagnostic_buffer) =
290     diagnostic_message_length_per_line;
291   prefixing_policy (diagnostic_buffer) = current_prefixing_rule;
292   set_real_maximum_length (diagnostic_buffer);
293 }
294
295 /* Reinitialize BUFFER.  */
296 void
297 output_clear (buffer)
298      output_buffer *buffer;
299 {
300   clear_text_info (buffer);
301   clear_diagnostic_info (buffer);
302 }
303
304 /* Finishes to construct a NULL-terminated character string representing
305    the BUFFERed message.  */
306 const char *
307 output_finish (buffer)
308      output_buffer *buffer;
309 {
310   obstack_1grow (&buffer->obstack, '\0');
311   return (const char *) obstack_finish (&buffer->obstack);
312 }
313
314 /* Return the amount of characters BUFFER can accept to
315    make a full line.  */
316 int
317 output_space_left (buffer)
318      const output_buffer *buffer;
319 {
320   return line_wrap_cutoff (buffer) - output_text_length (buffer);
321 }
322
323 /* Write out BUFFER's prefix.  */
324 void
325 output_emit_prefix (buffer)
326      output_buffer *buffer;
327 {
328   if (output_prefix (buffer) != NULL)
329     {
330       switch (prefixing_policy (buffer))
331         {
332         default:
333         case DIAGNOSTICS_SHOW_PREFIX_NEVER:
334           break;
335
336         case DIAGNOSTICS_SHOW_PREFIX_ONCE:
337           if (prefix_was_emitted_for (buffer))
338             break;
339           /* Else fall through.  */
340
341         case DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE:
342           {
343             int prefix_length = strlen (output_prefix (buffer));
344             output_append_r (buffer, output_prefix (buffer), prefix_length);
345             prefix_was_emitted_for (buffer) = 1;
346           }
347           break;
348         }
349     }
350 }
351
352 /* Have BUFFER start a new line.  */
353 void
354 output_add_newline (buffer)
355      output_buffer *buffer;
356 {
357   obstack_1grow (&buffer->obstack, '\n');
358   output_text_length (buffer) = 0;
359 }
360
361 /* Appends a character to BUFFER.  */
362 void
363 output_add_character (buffer, c)
364      output_buffer *buffer;
365      int c;
366 {
367   if (output_is_line_wrapping (buffer) && output_space_left (buffer) <= 0)
368     output_add_newline (buffer);
369   obstack_1grow (&buffer->obstack, c);
370   ++output_text_length (buffer);
371 }
372
373 /* Adds a space to BUFFER.  */
374 void
375 output_add_space (buffer)
376      output_buffer *buffer;
377 {
378   if (output_is_line_wrapping (buffer) && output_space_left (buffer) <= 0)
379     {
380       output_add_newline (buffer);
381       return;
382     }
383   obstack_1grow (&buffer->obstack, ' ');
384   ++output_text_length (buffer);
385 }
386
387 /* These functions format an INTEGER into BUFFER as suggested by their
388    names.  */
389 void
390 output_decimal (buffer, i)
391      output_buffer *buffer;
392      int i;
393 {
394   output_formatted_integer (buffer, "%d", i);
395 }
396
397 static void
398 output_long_decimal (buffer, i)
399      output_buffer *buffer;
400      long int i;
401 {
402   output_formatted_integer (buffer, "%ld", i);
403 }
404
405 static void
406 output_unsigned_decimal (buffer, i)
407      output_buffer *buffer;
408      unsigned int i;
409 {
410   output_formatted_integer (buffer, "%u", i);
411 }
412
413 static void
414 output_long_unsigned_decimal (buffer, i)
415      output_buffer *buffer;
416      long unsigned int i;
417 {
418   output_formatted_integer (buffer, "%lu", i);
419 }
420
421 static void
422 output_octal (buffer, i)
423      output_buffer *buffer;
424      unsigned int i;
425 {
426   output_formatted_integer (buffer, "%o", i);
427 }
428
429 static void
430 output_long_octal (buffer, i)
431      output_buffer *buffer;
432      unsigned long int i;
433 {
434   output_formatted_integer (buffer, "%lo", i);
435 }
436
437 static void
438 output_hexadecimal (buffer, i)
439      output_buffer *buffer;
440      unsigned int i;
441 {
442   output_formatted_integer (buffer, "%x", i);
443 }
444
445 static void
446 output_long_hexadecimal (buffer, i)
447      output_buffer *buffer;
448      unsigned long int i;
449 {
450   output_formatted_integer (buffer, "%lx", i);
451 }
452
453 /* Append to BUFFER a string specified by its STARTING character
454    and LENGTH.  */
455 static void
456 output_append_r (buffer, start, length)
457      output_buffer *buffer;
458      const char *start;
459      int length;
460 {
461   obstack_grow (&buffer->obstack, start, length);
462   output_text_length (buffer) += length;
463 }
464
465 /* Append a string deliminated by START and END to BUFFER.  No wrapping is
466    done.  However, if beginning a new line then emit output_prefix (BUFFER)
467    and skip any leading whitespace if appropriate.  The caller must ensure
468    that it is safe to do so.  */
469 void
470 output_append (buffer, start, end)
471      output_buffer *buffer;
472      const char *start;
473      const char *end;
474 {
475   /* Emit prefix and skip whitespace if we're starting a new line.  */
476   if (is_starting_newline (buffer))
477     {
478       output_emit_prefix (buffer);
479       if (output_is_line_wrapping (buffer))
480         while (start != end && *start == ' ')
481           ++start;
482     }
483   output_append_r (buffer, start, end - start);
484 }
485
486 /* Wrap a text delimited by START and END into BUFFER.  */
487 static void
488 wrap_text (buffer, start, end)
489      output_buffer *buffer;
490      const char *start;
491      const char *end;
492 {
493   while (start != end)
494     {
495       /* Dump anything bodered by whitespaces.  */ 
496       {
497         const char *p = start;
498         while (p != end && *p != ' ' && *p != '\n')
499           ++p;
500         if (p - start >= output_space_left (buffer))
501           output_add_newline (buffer);
502         output_append (buffer, start, p);
503         start = p;
504       }
505
506       if (start != end && *start == ' ')
507         {
508           output_add_space (buffer);
509           ++start;
510         }
511       if (start != end && *start == '\n')
512         {
513           output_add_newline (buffer);
514           ++start;
515         }
516     }
517 }
518
519 /* Same as wrap_text but wrap text only when in line-wrapping mode.  */
520 static void
521 maybe_wrap_text (buffer, start, end)
522      output_buffer *buffer;
523      const char *start;
524      const char *end;
525 {
526   if (output_is_line_wrapping (buffer))
527     wrap_text (buffer, start, end);
528   else
529     output_append (buffer, start, end);
530 }
531
532
533 /* Append a STRING to BUFFER; the STRING maybe be line-wrapped if in
534    appropriate mode.  */
535
536 void
537 output_add_string (buffer, str)
538      output_buffer *buffer;
539      const char *str;
540 {
541   maybe_wrap_text (buffer, str, str + (str ? strlen (str) : 0));
542 }
543
544 /* Flush the content of BUFFER onto FILE and reinitialize BUFFER.  */
545
546 static void
547 output_to_stream (buffer, file)
548      output_buffer *buffer;
549      FILE *file;
550 {
551   const char *text = output_finish (buffer);
552   fputs (text, file);
553   clear_text_info (buffer);
554 }
555
556 /* Format a message pointed to by output_buffer_text_cursor (BUFFER) using
557    output_buffer_format_args (BUFFER) as appropriate.  The following format
558    specifiers are recognized as  being language independent:
559    %d, %i: (signed) integer in base ten.
560    %u: unsigned integer in base ten.
561    %o: unsigned integer in base eight.
562    %x: unsigned integer in base sixteen.
563    %ld, %li, %lo, %lu, %lx: long versions of the above.
564    %c: character.
565    %s: string.
566    %%: `%'.
567    %*.s: a substring the length of which is specified by an integer.  */
568 static void
569 output_format (buffer)
570      output_buffer *buffer;
571 {
572   for (; *output_buffer_text_cursor (buffer);
573        ++output_buffer_text_cursor (buffer))
574     {
575       int long_integer = 0;
576       /* Ignore text.  */
577       {
578         const char *p = output_buffer_text_cursor (buffer);
579         while (*p && *p != '%')
580           ++p;
581         maybe_wrap_text (buffer, output_buffer_text_cursor (buffer), p);
582         output_buffer_text_cursor (buffer) = p;
583       }
584       if (!*output_buffer_text_cursor (buffer))
585         break;
586
587       /* We got a '%'.  Let's see what happens. Record whether we're
588          parsing a long integer format specifier.  */
589       if (*++output_buffer_text_cursor (buffer) == 'l')
590         {
591           long_integer = 1;
592           ++output_buffer_text_cursor (buffer);
593         }
594
595       /* Handle %c, %d, %i, %ld, %li, %lo, %lu, %lx, %o, %s, %u,
596          %x, %.*s; %%.  And nothing else.  Front-ends should install
597          printers to grok language specific format specifiers.  */
598       switch (*output_buffer_text_cursor (buffer))
599         {
600         case 'c':
601           output_add_character
602             (buffer, va_arg (output_buffer_format_args (buffer), int));
603           break;
604           
605         case 'd':
606         case 'i':
607           if (long_integer)
608             output_long_decimal
609               (buffer, va_arg (output_buffer_format_args (buffer), long int));
610           else
611             output_decimal
612               (buffer, va_arg (output_buffer_format_args (buffer), int));
613           break;
614
615         case 'o':
616           if (long_integer)
617             output_long_octal (buffer,
618                                va_arg (output_buffer_format_args (buffer),
619                                        unsigned long int));
620           else
621             output_octal (buffer,
622                           va_arg (output_buffer_format_args (buffer),
623                                   unsigned int));
624           break;
625
626         case 's':
627           output_add_string (buffer,
628                              va_arg (output_buffer_format_args (buffer),
629                                      const char *));
630           break;
631
632         case 'u':
633           if (long_integer)
634             output_long_unsigned_decimal
635               (buffer, va_arg (output_buffer_format_args (buffer),
636                                long unsigned int));
637           else
638             output_unsigned_decimal
639               (buffer, va_arg (output_buffer_format_args (buffer),
640                                unsigned int));
641           
642         case 'x':
643           if (long_integer)
644             output_long_hexadecimal
645               (buffer, va_arg (output_buffer_format_args (buffer),
646                                unsigned long int));
647           else
648             output_hexadecimal
649               (buffer, va_arg (output_buffer_format_args (buffer),
650                                unsigned int));
651           break;
652
653         case '%':
654           output_add_character (buffer, '%');
655           break;
656
657         case '.':
658           {
659             int n;
660             const char *s;
661             /* We handle no precision specifier but `%.*s'.  */
662             if (*++output_buffer_text_cursor (buffer) != '*')
663               abort ();
664             else if (*++output_buffer_text_cursor (buffer) != 's')
665               abort();
666             n = va_arg (output_buffer_format_args (buffer), int);
667             s = va_arg (output_buffer_format_args (buffer), const char *);
668             output_append (buffer, s, s + n);
669           }
670           break;
671
672         default:
673           if (!lang_printer || !(*lang_printer) (buffer))
674             {
675               /* Hmmm.  The front-end failed to install a format translator
676                  but called us with an unrecognized format.  Sorry.  */
677               abort();
678             }
679         }
680     }
681 }
682
683 static char *
684 vbuild_message_string (msgid, ap)
685      const char *msgid;
686      va_list ap;
687 {
688   char *str;
689
690   vasprintf (&str, msgid, ap);
691   return str;
692 }
693
694 /*  Return a malloc'd string containing MSGID formatted a la
695     printf.  The caller is reponsible for freeing the memory.  */
696
697 static char *
698 build_message_string VPARAMS ((const char *msgid, ...))
699 {
700 #ifndef ANSI_PROTOTYPES
701   const char *msgid;
702 #endif
703   va_list ap;
704   char *str;
705
706   VA_START (ap, msgid);
707
708 #ifndef ANSI_PROTOTYPES
709   msgid = va_arg (ap, const char *);
710 #endif
711
712   str = vbuild_message_string (msgid, ap);
713
714   va_end (ap);
715
716   return str;
717 }
718
719
720 /* Return a malloc'd string describing a location.  The caller is
721    responsible for freeing the memory.  */
722
723 static char *
724 context_as_prefix (file, line, warn)
725      const char *file;
726      int line;
727      int warn;
728 {
729   if (file)
730     {
731       if (warn)
732         return build_message_string ("%s:%d: warning: ", file, line);
733       else
734         return build_message_string ("%s:%d: ", file, line);
735     }
736   else
737     {
738       if (warn)
739         return build_message_string ("%s: warning: ", progname);
740       else
741         return build_message_string ("%s: ", progname);
742     }
743 }
744
745 /* Format a MESSAGE into BUFFER.  Automatically wrap lines.  */
746
747 static void
748 output_do_printf (buffer, msgid)
749      output_buffer *buffer;
750      const char *msgid;
751 {
752   char *message = vbuild_message_string (msgid,
753                                          output_buffer_format_args (buffer));
754
755   output_add_string (buffer, message);
756   free (message);
757 }
758
759
760 /* Format a message into BUFFER a la printf.  */
761
762 void
763 output_printf VPARAMS ((struct output_buffer *buffer, const char *msgid, ...))
764 {
765 #ifndef ANSI_PROTOTYPES
766   struct output_buffer *buffer;
767   const char *msgid;
768 #endif
769   va_list ap;
770   va_list *old_args;
771
772   VA_START (ap, msgid);
773 #ifndef ANSI_PROTOTYPES
774   buffer = va_arg (ap, output_buffer *);
775   msgid = va_arg (ap, const char *);
776 #endif
777   old_args = output_buffer_ptr_to_format_args (buffer);
778   output_buffer_ptr_to_format_args (buffer) = &ap;
779   output_do_printf (buffer, msgid);
780   output_buffer_ptr_to_format_args (buffer) = old_args;
781   va_end (ap);
782 }
783
784 /* Print the message MSGID in FILE.  */
785
786 static void
787 vnotice (file, msgid, ap)
788      FILE *file;
789      const char *msgid;
790      va_list ap;
791 {
792   vfprintf (file, _(msgid), ap);
793 }
794
795 /* Print a message relevant to the given DECL.  */
796
797 static void
798 format_with_decl (buffer, decl)
799      output_buffer *buffer;
800      tree decl;
801 {
802   const char *p;
803   
804   /* Do magic to get around lack of varargs support for insertion
805      of arguments into existing list.  We know that the decl is first;
806      we ass_u_me that it will be printed with "%s".  */
807   for (p = output_buffer_text_cursor (buffer); *p; ++p)
808     {
809       if (*p == '%')
810         {
811           if (*(p + 1) == '%')
812             ++p;
813           else if (*(p + 1) != 's')
814             abort ();
815           else
816             break;
817         }
818     }
819
820   /* Print the left-hand substring.  */
821   maybe_wrap_text (buffer, output_buffer_text_cursor (buffer), p);
822   
823   if (*p == '%')                /* Print the name.  */
824     {
825       const char *n = (DECL_NAME (decl)
826                  ? (*decl_printable_name) (decl, 2)
827                  : _("((anonymous))"));
828       output_add_string (buffer, n);
829       while (*p)
830         {
831           ++p;
832           if (ISALPHA (*(p - 1) & 0xFF))
833             break;
834         }
835     }
836
837   if (*p)                       /* Print the rest of the message.  */
838     {
839       output_buffer_text_cursor (buffer) = p;
840       output_format (buffer);
841     }
842 }
843
844 /* Figure file and line of the given INSN.  */
845
846 static void
847 file_and_line_for_asm (insn, pfile, pline)
848      rtx insn;
849      const char **pfile;
850      int *pline;
851 {
852   rtx body = PATTERN (insn);
853   rtx asmop;
854
855   /* Find the (or one of the) ASM_OPERANDS in the insn.  */
856   if (GET_CODE (body) == SET && GET_CODE (SET_SRC (body)) == ASM_OPERANDS)
857     asmop = SET_SRC (body);
858   else if (GET_CODE (body) == ASM_OPERANDS)
859     asmop = body;
860   else if (GET_CODE (body) == PARALLEL
861            && GET_CODE (XVECEXP (body, 0, 0)) == SET)
862     asmop = SET_SRC (XVECEXP (body, 0, 0));
863   else if (GET_CODE (body) == PARALLEL
864            && GET_CODE (XVECEXP (body, 0, 0)) == ASM_OPERANDS)
865     asmop = XVECEXP (body, 0, 0);
866   else
867     asmop = NULL;
868
869   if (asmop)
870     {
871       *pfile = ASM_OPERANDS_SOURCE_FILE (asmop);
872       *pline = ASM_OPERANDS_SOURCE_LINE (asmop);
873     }
874   else
875     {
876       *pfile = input_filename;
877       *pline = lineno;
878     }
879 }
880
881 /* Report a diagnostic MESSAGE (an errror or a WARNING) at the line number
882    of the insn INSN.  This is used only when INSN is an `asm' with operands,
883    and each ASM_OPERANDS records its own source file and line.  */
884 static void
885 diagnostic_for_asm (insn, msg, args_ptr, warn)
886      rtx insn;
887      const char *msg;
888      va_list *args_ptr;
889      int warn;
890 {
891   const char *file;
892   int line;
893
894   file_and_line_for_asm (insn, &file, &line);
895   report_diagnostic (msg, args_ptr, file, line, warn);
896 }
897
898 /* Report a diagnostic MESSAGE at the declaration DECL.
899    MSG is a format string which uses %s to substitute the declaration
900    name; subsequent substitutions are a la output_format.  */
901 static void
902 diagnostic_for_decl (decl, msg, args_ptr, warn)
903      tree decl;
904      const char *msg;
905      va_list *args_ptr;
906      int warn;
907 {
908   output_state os;
909
910   if (diagnostic_lock++)
911     error_recursion ();
912
913   if (count_error (warn))
914     {
915       os = diagnostic_buffer->state;
916       report_error_function (DECL_SOURCE_FILE (decl));
917       output_set_prefix
918         (diagnostic_buffer, context_as_prefix
919          (DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl), warn));
920       output_buffer_ptr_to_format_args (diagnostic_buffer) = args_ptr;
921       output_buffer_text_cursor (diagnostic_buffer) = msg;
922       format_with_decl (diagnostic_buffer, decl);
923       finish_diagnostic ();
924       output_destroy_prefix (diagnostic_buffer);
925   
926       diagnostic_buffer->state = os;
927     }
928   diagnostic_lock--;
929 }
930
931 \f
932 /* Count an error or warning.  Return 1 if the message should be printed.  */
933
934 int
935 count_error (warningp)
936      int warningp;
937 {
938   if (warningp && inhibit_warnings)
939     return 0;
940
941   if (warningp && !warnings_are_errors)
942     warningcount++;
943   else
944     {
945       static int warning_message = 0;
946
947       if (warningp && !warning_message)
948         {
949           verbatim ("%s: warnings being treated as errors\n", progname);
950           warning_message = 1;
951         }
952       errorcount++;
953     }
954
955   return 1;
956 }
957
958 /* Print a diagnistic MSGID on FILE.  */
959 void
960 fnotice VPARAMS ((FILE *file, const char *msgid, ...))
961 {
962 #ifndef ANSI_PROTOTYPES
963   FILE *file;
964   const char *msgid;
965 #endif
966   va_list ap;
967
968   VA_START (ap, msgid);
969
970 #ifndef ANSI_PROTOTYPES
971   file = va_arg (ap, FILE *);
972   msgid = va_arg (ap, const char *);
973 #endif
974
975   vnotice (file, msgid, ap);
976   va_end (ap);
977 }
978
979
980 /* Print a fatal error message.  NAME is the text.
981    Also include a system error message based on `errno'.  */
982
983 void
984 pfatal_with_name (name)
985   const char *name;
986 {
987   fprintf (stderr, "%s: ", progname);
988   perror (name);
989   exit (FATAL_EXIT_CODE);
990 }
991
992 void
993 fatal_io_error (name)
994   const char *name;
995 {
996   verbatim ("%s: %s: I/O error\n", progname, name);
997   exit (FATAL_EXIT_CODE);
998 }
999
1000 /* Issue a pedantic warning MSGID.  */
1001 void
1002 pedwarn VPARAMS ((const char *msgid, ...))
1003 {
1004 #ifndef ANSI_PROTOTYPES
1005   const char *msgid;
1006 #endif
1007   va_list ap;
1008
1009   VA_START (ap, msgid);
1010
1011 #ifndef ANSI_PROTOTYPES
1012   msgid = va_arg (ap, const char *);
1013 #endif
1014
1015   report_diagnostic (msgid, &ap, input_filename, lineno,
1016                      !flag_pedantic_errors);
1017   va_end (ap);
1018 }
1019
1020 /* Issue a pedantic waring about DECL.  */
1021 void
1022 pedwarn_with_decl VPARAMS ((tree decl, const char *msgid, ...))
1023 {
1024 #ifndef ANSI_PROTOTYPES
1025   tree decl;
1026   const char *msgid;
1027 #endif
1028   va_list ap;
1029
1030   VA_START (ap, msgid);
1031
1032 #ifndef ANSI_PROTOTYPES
1033   decl = va_arg (ap, tree);
1034   msgid = va_arg (ap, const char *);
1035 #endif
1036   /* We don't want -pedantic-errors to cause the compilation to fail from
1037      "errors" in system header files.  Sometimes fixincludes can't fix what's
1038      broken (eg: unsigned char bitfields - fixing it may change the alignment
1039      which will cause programs to mysteriously fail because the C library
1040      or kernel uses the original layout).  There's no point in issuing a
1041      warning either, it's just unnecessary noise.  */
1042   if (!DECL_IN_SYSTEM_HEADER (decl))
1043     diagnostic_for_decl (decl, msgid, &ap, !flag_pedantic_errors);
1044   va_end (ap);
1045 }
1046
1047 /* Same as above but within the context FILE and LINE. */
1048 void
1049 pedwarn_with_file_and_line VPARAMS ((const char *file, int line,
1050                                      const char *msgid, ...))
1051 {
1052 #ifndef ANSI_PROTOTYPES
1053   const char *file;
1054   int line;
1055   const char *msgid;
1056 #endif
1057   va_list ap;
1058
1059   VA_START (ap, msgid);
1060
1061 #ifndef ANSI_PROTOTYPES
1062   file = va_arg (ap, const char *);
1063   line = va_arg (ap, int);
1064   msgid = va_arg (ap, const char *);
1065 #endif
1066
1067   report_diagnostic (msgid, &ap, file, line, !flag_pedantic_errors);
1068   va_end (ap);
1069 }
1070
1071 /* Just apologize with MSGID.  */
1072 void
1073 sorry VPARAMS ((const char *msgid, ...))
1074 {
1075 #ifndef ANSI_PROTOTYPES
1076   const char *msgid;
1077 #endif
1078   va_list ap;
1079   output_state os;
1080
1081   os = diagnostic_buffer->state;
1082   VA_START (ap, msgid);
1083
1084 #ifndef ANSI_PROTOTYPES
1085   msgid = va_arg (ap, const char *);
1086 #endif
1087   ++sorrycount;
1088   output_set_prefix
1089     (diagnostic_buffer, context_as_prefix (input_filename, lineno, 0));
1090   output_printf (diagnostic_buffer, "sorry, not implemented: ");
1091   output_buffer_ptr_to_format_args (diagnostic_buffer) = &ap;
1092   output_buffer_text_cursor (diagnostic_buffer) = msgid;
1093   output_format (diagnostic_buffer);
1094   finish_diagnostic ();
1095   diagnostic_buffer->state = os;
1096   va_end (ap);
1097 }
1098
1099 /* Called when the start of a function definition is parsed,
1100    this function prints on stderr the name of the function.  */
1101
1102 void
1103 announce_function (decl)
1104      tree decl;
1105 {
1106   if (! quiet_flag)
1107     {
1108       if (rtl_dump_and_exit)
1109         verbatim ("%s ", IDENTIFIER_POINTER (DECL_NAME (decl)));
1110       else
1111         verbatim (" %s", (*decl_printable_name) (decl, 2));
1112       fflush (stderr);
1113       need_error_newline = 1;
1114       last_error_function = current_function_decl;
1115     }
1116 }
1117
1118 /* The default function to print out name of current function that caused
1119    an error.  */
1120
1121 void
1122 default_print_error_function (file)
1123   const char *file;
1124 {
1125   if (last_error_function != current_function_decl)
1126     {
1127       char *prefix = file ? build_message_string ("%s: ", file) : NULL;
1128       output_state os;
1129
1130       os = diagnostic_buffer->state;
1131       output_set_prefix (diagnostic_buffer, prefix);
1132       
1133       if (current_function_decl == NULL)
1134         {
1135           output_add_string (diagnostic_buffer, "At top level:");
1136           output_add_newline (diagnostic_buffer);
1137         }
1138       else
1139         {
1140           if (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
1141             output_printf
1142               (diagnostic_buffer, "In method `%s':\n",
1143                (*decl_printable_name) (current_function_decl, 2));
1144           else
1145             output_printf
1146               (diagnostic_buffer, "In function `%s':\n",
1147                (*decl_printable_name) (current_function_decl, 2));
1148         }
1149
1150       last_error_function = current_function_decl;
1151       output_to_stream (diagnostic_buffer, stderr);
1152       diagnostic_buffer->state = os;
1153       free ((char*) prefix);
1154     }
1155 }
1156
1157 /* Prints out, if necessary, the name of the current function
1158   that caused an error.  Called from all error and warning functions.
1159   We ignore the FILE parameter, as it cannot be relied upon.  */
1160
1161 void
1162 report_error_function (file)
1163   const char *file ATTRIBUTE_UNUSED;
1164 {
1165   struct file_stack *p;
1166
1167   if (need_error_newline)
1168     {
1169       verbatim ("\n");
1170       need_error_newline = 0;
1171     }
1172
1173   if (input_file_stack && input_file_stack->next != 0
1174       && input_file_stack_tick != last_error_tick)
1175     {
1176       for (p = input_file_stack->next; p; p = p->next)
1177         if (p == input_file_stack->next)
1178           verbatim ("In file included from %s:%d", p->name, p->line);
1179         else
1180           verbatim (",\n                 from %s:%d", p->name, p->line);
1181       verbatim (":\n");
1182       last_error_tick = input_file_stack_tick;
1183     }
1184
1185   (*print_error_function) (input_filename);
1186 }
1187
1188 void
1189 error_with_file_and_line VPARAMS ((const char *file, int line,
1190                                    const char *msgid, ...))
1191 {
1192 #ifndef ANSI_PROTOTYPES
1193   const char *file;
1194   int line;
1195   const char *msgid;
1196 #endif
1197   va_list ap;
1198
1199   VA_START (ap, msgid);
1200
1201 #ifndef ANSI_PROTOTYPES
1202   file = va_arg (ap, const char *);
1203   line = va_arg (ap, int);
1204   msgid = va_arg (ap, const char *);
1205 #endif
1206
1207   report_diagnostic (msgid, &ap, file, line, /* warn = */ 0);
1208   va_end (ap);
1209 }
1210
1211 void
1212 error_with_decl VPARAMS ((tree decl, const char *msgid, ...))
1213 {
1214 #ifndef ANSI_PROTOTYPES
1215   tree decl;
1216   const char *msgid;
1217 #endif
1218   va_list ap;
1219
1220   VA_START (ap, msgid);
1221
1222 #ifndef ANSI_PROTOTYPES
1223   decl = va_arg (ap, tree);
1224   msgid = va_arg (ap, const char *);
1225 #endif
1226
1227   diagnostic_for_decl (decl, msgid, &ap, /* warn = */ 0);
1228   va_end (ap);
1229 }
1230
1231 void
1232 error_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
1233 {
1234 #ifndef ANSI_PROTOTYPES
1235   rtx insn;
1236   const char *msgid;
1237 #endif
1238   va_list ap;
1239
1240   VA_START (ap, msgid);
1241
1242 #ifndef ANSI_PROTOTYPES
1243   insn = va_arg (ap, rtx);
1244   msgid = va_arg (ap, const char *);
1245 #endif
1246
1247   diagnostic_for_asm (insn, msgid, &ap, /* warn = */ 0);
1248   va_end (ap);
1249 }
1250
1251 void
1252 error VPARAMS ((const char *msgid, ...))
1253 {
1254 #ifndef ANSI_PROTOTYPES
1255   const char *msgid;
1256 #endif
1257   va_list ap;
1258
1259   VA_START (ap, msgid);
1260
1261 #ifndef ANSI_PROTOTYPES
1262   msgid = va_arg (ap, const char *);
1263 #endif
1264
1265   report_diagnostic (msgid, &ap, input_filename, lineno, /* warn = */ 0);
1266   va_end (ap);
1267 }
1268
1269 /* Report a fatal error at the current line number.  Allow a front end to
1270    intercept the message.  */
1271 void
1272 fatal VPARAMS ((const char *msgid, ...))
1273 {
1274 #ifndef ANSI_PROTOTYPES
1275   const char *msgid;
1276 #endif
1277   va_list ap;
1278
1279   VA_START (ap, msgid);
1280
1281 #ifndef ANSI_PROTOTYPES
1282   msgid = va_arg (ap, const char *);
1283 #endif
1284
1285   report_diagnostic (msgid, &ap, input_filename, lineno, 0);
1286   va_end (ap);
1287   exit (FATAL_EXIT_CODE);
1288 }
1289
1290 void
1291 _fatal_insn (msgid, insn, file, line, function)
1292      const char *msgid;
1293      rtx insn;
1294      const char *file;
1295      int line;
1296      const char *function;
1297 {
1298   error ("%s", msgid);
1299   debug_rtx (insn);
1300   fancy_abort (file, line, function);
1301 }
1302
1303 void
1304 _fatal_insn_not_found (insn, file, line, function)
1305      rtx insn;
1306      const char *file;
1307      int line;
1308      const char *function;
1309 {
1310   if (INSN_CODE (insn) < 0)
1311     _fatal_insn ("Unrecognizable insn:", insn, file, line, function);
1312   else
1313     _fatal_insn ("Insn does not satisfy its constraints:",
1314                 insn, file, line, function);
1315 }
1316
1317 void
1318 warning_with_file_and_line VPARAMS ((const char *file, int line,
1319                                      const char *msgid, ...))
1320 {
1321 #ifndef ANSI_PROTOTYPES
1322   const char *file;
1323   int line;
1324   const char *msgid;
1325 #endif
1326   va_list ap;
1327
1328   VA_START (ap, msgid);
1329
1330 #ifndef ANSI_PROTOTYPES
1331   file = va_arg (ap, const char *);
1332   line = va_arg (ap, int);
1333   msgid = va_arg (ap, const char *);
1334 #endif
1335
1336   report_diagnostic (msgid, &ap, file, line, /* warn = */ 1);
1337   va_end (ap);
1338 }
1339
1340 void
1341 warning_with_decl VPARAMS ((tree decl, const char *msgid, ...))
1342 {
1343 #ifndef ANSI_PROTOTYPES
1344   tree decl;
1345   const char *msgid;
1346 #endif
1347   va_list ap;
1348
1349   VA_START (ap, msgid);
1350
1351 #ifndef ANSI_PROTOTYPES
1352   decl = va_arg (ap, tree);
1353   msgid = va_arg (ap, const char *);
1354 #endif
1355
1356   diagnostic_for_decl (decl, msgid, &ap, /* warn = */ 1);
1357   va_end (ap);
1358 }
1359
1360 void
1361 warning_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
1362 {
1363 #ifndef ANSI_PROTOTYPES
1364   rtx insn;
1365   const char *msgid;
1366 #endif
1367   va_list ap;
1368
1369   VA_START (ap, msgid);
1370
1371 #ifndef ANSI_PROTOTYPES
1372   insn = va_arg (ap, rtx);
1373   msgid = va_arg (ap, const char *);
1374 #endif
1375
1376   diagnostic_for_asm (insn, msgid, &ap, /* warn = */ 1);
1377   va_end (ap);
1378 }
1379
1380 void
1381 warning VPARAMS ((const char *msgid, ...))
1382 {
1383 #ifndef ANSI_PROTOTYPES
1384   const char *msgid;
1385 #endif
1386   va_list ap;
1387
1388   VA_START (ap, msgid);
1389
1390 #ifndef ANSI_PROTOTYPES
1391   msgid = va_arg (ap, const char *);
1392 #endif
1393
1394   report_diagnostic (msgid, &ap, input_filename, lineno, /* warn = */ 1);
1395   va_end (ap);
1396 }
1397
1398 /* Flush diagnostic_buffer content on stderr.  */
1399 static void
1400 finish_diagnostic ()
1401 {
1402   output_to_stream (diagnostic_buffer, stderr);
1403   clear_diagnostic_info (diagnostic_buffer);
1404   fputc ('\n', stderr);
1405   fflush (stderr);
1406 }
1407
1408 /* Helper subroutine of output_verbatim and verbatim. Do the approriate
1409    settings needed by BUFFER for a verbatim formatting.  */
1410 static void
1411 output_do_verbatim (buffer, msg, args_ptr)
1412      output_buffer *buffer;
1413      const char *msg;
1414      va_list *args_ptr;
1415 {
1416   output_state os;
1417
1418   os = buffer->state;
1419   output_prefix (buffer) = NULL;
1420   prefixing_policy (buffer) = DIAGNOSTICS_SHOW_PREFIX_NEVER;
1421   output_buffer_text_cursor (buffer) = msg;
1422   output_buffer_ptr_to_format_args (buffer) = args_ptr;
1423   output_set_maximum_length (buffer, 0);
1424   output_format (buffer);
1425   buffer->state = os;
1426 }
1427
1428 /* Output MESSAGE verbatim into BUFFER.  */
1429 void
1430 output_verbatim VPARAMS ((output_buffer *buffer, const char *msg, ...))
1431 {
1432 #ifndef ANSI_PROTOTYPES
1433   output_buffer *buffer;
1434   const char *msg;
1435 #endif
1436   va_list ap;
1437
1438   VA_START (ap, msg);
1439 #ifndef ANSI_PROTOTYPES
1440   buffer = va_arg (ap, output_buffer *);
1441   msg = va_arg (ap, const char *);
1442 #endif
1443   output_do_verbatim (buffer, msg, &ap);
1444   va_end (ap);
1445 }
1446
1447 /* Same as above but use diagnostic_buffer.  */
1448 void
1449 verbatim VPARAMS ((const char *msg, ...))
1450 {
1451 #ifndef ANSI_PROTOTYPES
1452   const char *msg;
1453 #endif
1454   va_list ap;
1455
1456   VA_START (ap, msg);
1457 #ifndef ANSI_PROTOTYPES
1458   msg = va_arg (ap, const char *);
1459 #endif
1460   output_do_verbatim (diagnostic_buffer, msg, &ap);
1461   output_to_stream (diagnostic_buffer, stderr);
1462   va_end (ap);
1463 }
1464
1465 /* Report a diagnostic MESSAGE (an error or a WARNING) involving
1466    entities in ARGUMENTS.  FILE and LINE indicate where the diagnostic
1467    occurs.  This function is *the* subroutine in terms of which front-ends
1468    should implement their specific diagnostic handling modules.
1469    The front-end independent format specifiers are exactly those described
1470    in the documentation of output_format.  */
1471 void
1472 report_diagnostic (msg, args_ptr, file, line, warn)
1473      const char *msg;
1474      va_list *args_ptr;
1475      const char *file;
1476      int line;
1477      int warn;
1478 {
1479   output_state os;
1480
1481   if (diagnostic_lock++)
1482     error_recursion ();
1483
1484   if (count_error (warn))
1485     {
1486       os = diagnostic_buffer->state;
1487       diagnostic_msg = msg;
1488       diagnostic_args = args_ptr;
1489       report_error_function (file);
1490       output_set_prefix
1491         (diagnostic_buffer, context_as_prefix (file, line, warn));
1492       output_format (diagnostic_buffer);
1493       finish_diagnostic ();
1494       output_destroy_prefix (diagnostic_buffer);
1495       diagnostic_buffer->state = os;
1496     }
1497
1498   diagnostic_lock--;
1499 }
1500
1501 /* Inform the user that an error occurred while trying to report some
1502    other error.  This indicates catastrophic internal inconsistencies,
1503    so give up now.  But do try to flush out the previous error.  */
1504 static void
1505 error_recursion ()
1506 {
1507   if (diagnostic_lock < 3)
1508     finish_diagnostic ();
1509
1510   fprintf (stderr,
1511 "Internal compiler error: Error reporting routines re-entered.\n\
1512 Please submit a full bug report.\n\
1513 See %s for instructions.\n", GCCBUGURL);
1514
1515   exit (FATAL_EXIT_CODE);
1516 }
1517
1518 /* Given a partial pathname as input, return another pathname that
1519    shares no directory elements with the pathname of __FILE__.  This
1520    is used by fancy_abort() to print `Internal compiler error in expr.c'
1521    instead of `Internal compiler error in ../../egcs/gcc/expr.c'.  */
1522 static const char *
1523 trim_filename (name)
1524      const char *name;
1525 {
1526   static const char this_file[] = __FILE__;
1527   const char *p = name, *q = this_file;
1528
1529   while (*p == *q && *p != 0 && *q != 0) p++, q++;
1530   while (p > name && p[-1] != DIR_SEPARATOR
1531 #ifdef DIR_SEPARATOR_2
1532          && p[-1] != DIR_SEPARATOR_2
1533 #endif
1534          )
1535     p--;
1536
1537   return p;
1538 }
1539
1540 /* Report an internal compiler error in a friendly manner and without
1541    dumping core.  */
1542
1543 void
1544 fancy_abort (file, line, function)
1545      const char *file;
1546      int line;
1547      const char *function;
1548 {
1549   fatal (
1550 "Internal compiler error in %s, at %s:%d\n\
1551 Please submit a full bug report.\n\
1552 See %s for instructions.",
1553          function, trim_filename (file), line, GCCBUGURL);
1554 }