PATCH to move diagnostic formatting options into language independent module
Gabriel Dos Reis
gdr@codesourcery.com
Tue Jun 6 15:16:00 GMT 2000
This patch makes diagnostic messages formatting options a language
independent issue. We expect that, in the near future, all front-ends
will honor them (currently, only the C++ front-end uses this
machinery).
Committed after approval from Mark. Bootstrapped and tested on
i686-pc-linux-gnu.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com
2000-06-06 Gabriel Dos Reis <gdr@codesourcery.com>
* diagnostic.c (output_maximum_width): Remove.
(doing_line_wrapping): Tweak.
(diagnostic_buffer): New object.
(global_output_buffer): New object.
(output_destroy_prefix): New function.
(default_initialize_buffer): Likewise.
(reshape_diagnostic_buffer): Likewise.
(initialize_diagnostics): Likewise.
(output_clear): Tweak.
(line_wrapper_printf): Adjust call to init_output_buffer.
(vline_wrapper_message_with_location): Likewise. Use
output_destroy_prefix.
(v_message_with_decl): Likewise.
* diagnostic.h (struct output_buffer): Constify prefix.
(init_output_buffer, output_get_prefix): Constify.
(diagnostic_message_length_per_line): Likewise.
(reshape_diagnostic_buffer): Declare.
(default_initialize_buffer): Declare.
(initialize_diagnostics): Declare.
(diagnostic_buffer): Declare new obbject.
* toplev.c: #include diagnostic.h
(display_help): Document diagnostic formatting options.
(decode_f_option): Handle diagnostic formatting options.
(main): Setup initialization for diagnostic messages outputter.
* toplev.h (set_message_length): Remove.
* Makefile.in (toplev.o): Depends upon diagnostic.h
* invoke.texi : Document diagnostics formatting options.
cp/
2000-06-06 Gabriel Dos Reis <gdr@codesourcery.com>
* lex.c (lang_init_options): Tweak.
* decl2.c: Remove #inclusion of diagnostic.h
(lang_decode_option): Move diagnostic formatting options to
toplevel.
* lang-options.h: Remove documentation for diagnostic options.
* Makefile.in (lex.o): Depends upon diagnostic.h
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.462
diff -p -r1.462 Makefile.in
*** Makefile.in 2000/06/06 01:56:05 1.462
--- Makefile.in 2000/06/06 19:35:22
*************** diagnostic.o : diagnostic.c diagnostic.h
*** 1231,1237 ****
$(CONFIG_H) system.h $(TREE_H) $(RTL_H) tm_p.h flags.h \
$(GGC_H) input.h insn-attr.h insn-codes.h insn-config.h toplev.h intl.h
toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) function.h \
! flags.h input.h insn-attr.h xcoffout.h defaults.h output.h \
insn-codes.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h dwarfout.h \
dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
graph.h loop.h except.h regs.h $(TIMEVAR_H) $(lang_options_files)
--- 1231,1237 ----
$(CONFIG_H) system.h $(TREE_H) $(RTL_H) tm_p.h flags.h \
$(GGC_H) input.h insn-attr.h insn-codes.h insn-config.h toplev.h intl.h
toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) function.h \
! flags.h input.h insn-attr.h xcoffout.h defaults.h output.h diagnostic.h \
insn-codes.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h dwarfout.h \
dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
graph.h loop.h except.h regs.h $(TIMEVAR_H) $(lang_options_files)
Index: toplev.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.h,v
retrieving revision 1.41
diff -p -r1.41 toplev.h
*** toplev.h 2000/05/28 21:22:11 1.41
--- toplev.h 2000/06/06 19:35:22
*************** extern void fnotice PARAMS ((FILE *, c
*** 134,140 ****
extern int wrapup_global_declarations PARAMS ((union tree_node **, int));
extern void check_global_declarations PARAMS ((union tree_node **, int));
extern void note_deferral_of_defined_inline_function PARAMS ((union tree_node *));
- extern void set_message_length PARAMS ((int));
extern int errorcount;
extern int warningcount;
extern int sorrycount;
--- 134,139 ----
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.349
diff -p -r1.349 toplev.c
*** toplev.c 2000/06/03 21:28:37 1.349
--- toplev.c 2000/06/06 19:35:23
*************** Boston, MA 02111-1307, USA. */
*** 62,67 ****
--- 62,68 ----
#include "loop.h"
#include "regs.h"
#include "timevar.h"
+ #include "diagnostic.h"
#ifndef ACCUMULATE_OUTGOING_ARGS
#define ACCUMULATE_OUTGOING_ARGS 0
*************** display_help ()
*** 3703,3708 ****
--- 3704,3711 ----
printf (" -fcall-used-<register> Mark <register> as being corrupted by function calls\n");
printf (" -fcall-saved-<register> Mark <register> as being preserved across functions\n");
printf (" -finline-limit=<number> Limits the size of inlined functions to <number>\n");
+ printf (" -fmessage-length=<number> Limits diagnostics messages lengths to <number> characters per line. 0 suppresses line-wrapping\n");
+ printf (" -fdiagnostics-show-location=[once | never] Indicates how often source location information should be emitted, as prefix, at the beginning of diagnostics when line-wrapping\n");
for (i = NUM_ELEM (f_options); i--;)
{
*************** decode_f_option (arg)
*** 3990,3995 ****
--- 3993,4013 ----
nm = xstrdup (option_value);
stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, nm);
}
+ else if ((option_value
+ = skip_leading_substring (arg, "message-length=")))
+ diagnostic_message_length_per_line =
+ read_integral_parameter (option_value, arg - 2,
+ diagnostic_message_length_per_line);
+ else if ((option_value
+ = skip_leading_substring (arg, "diagnostics-show-location=")))
+ {
+ if (!strcmp (option_value, "once"))
+ set_message_prefixing_rule (DIAGNOSTICS_SHOW_PREFIX_ONCE);
+ else if (!strcmp (option_value, "every-line"))
+ set_message_prefixing_rule (DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE);
+ else
+ error ("Unrecognized option `%s'", arg - 2);
+ }
else if (!strcmp (arg, "no-stack-limit"))
stack_limit_rtx = NULL_RTX;
else if (!strcmp (arg, "preprocessed"))
*************** main (argc, argv)
*** 4433,4438 ****
--- 4451,4459 ----
ggc_add_tree_root (¤t_function_decl, 1);
ggc_add_tree_root (¤t_function_func_begin_label, 1);
+ /* Initialize the diagnostics reporting machinery. */
+ initialize_diagnostics();
+
/* Perform language-specific options intialization. */
lang_init_options ();
*************** main (argc, argv)
*** 4589,4594 ****
--- 4610,4618 ----
i++;
}
}
+
+ /* Reflect any language-specific diagnostic option setting. */
+ reshape_diagnostic_buffer ();
/* Checker uses the frame pointer. */
if (flag_check_memory_usage)
Index: diagnostic.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/diagnostic.h,v
retrieving revision 1.3
diff -p -r1.3 diagnostic.h
*** diagnostic.h 2000/05/14 08:44:46 1.3
--- diagnostic.h 2000/06/06 19:35:24
*************** struct output_buffer
*** 44,50 ****
/* The obstack where the text is built up. */
struct obstack obstack;
/* The prefix for each new line. */
! char *prefix;
/* The amount of characters output so far. */
int line_length;
/* The real upper bound of number of characters per line, taking into
--- 44,50 ----
/* The obstack where the text is built up. */
struct obstack obstack;
/* The prefix for each new line. */
! const char *prefix;
/* The amount of characters output so far. */
int line_length;
/* The real upper bound of number of characters per line, taking into
*************** struct output_buffer
*** 83,93 ****
extern printer_fn lang_printer;
/* Prototypes */
! void init_output_buffer PARAMS ((output_buffer *, char *, int));
void output_clear PARAMS ((output_buffer *));
! char *output_get_prefix PARAMS ((const output_buffer *));
! void output_set_prefix PARAMS ((output_buffer *, char *));
void output_set_maximum_length PARAMS ((output_buffer *, int));
void output_emit_prefix PARAMS ((output_buffer *));
void output_add_newline PARAMS ((output_buffer *));
--- 83,106 ----
extern printer_fn lang_printer;
+ extern int diagnostic_message_length_per_line;
+
+ /* This output buffer is used by front-ends that directly output
+ diagnostic messages without going through `error', `warning',
+ and simillar functions. In general, such usage should be
+ avoided. This global buffer will go away, once all such usage
+ has been removed. */
+ extern output_buffer *diagnostic_buffer;
+
/* Prototypes */
! void initialize_diagnostics PARAMS ((void));
! void reshape_diagnostic_buffer PARAMS ((void));
! void default_initialize_buffer PARAMS ((output_buffer *));
! void init_output_buffer PARAMS ((output_buffer *, const char *, int));
void output_clear PARAMS ((output_buffer *));
! const char *output_get_prefix PARAMS ((const output_buffer *));
! void output_set_prefix PARAMS ((output_buffer *, const char *));
! void output_destroy_prefix PARAMS ((output_buffer *));
void output_set_maximum_length PARAMS ((output_buffer *, int));
void output_emit_prefix PARAMS ((output_buffer *));
void output_add_newline PARAMS ((output_buffer *));
Index: diagnostic.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/diagnostic.c,v
retrieving revision 1.15
diff -p -r1.15 diagnostic.c
*** diagnostic.c 2000/05/20 19:45:33 1.15
--- diagnostic.c 2000/06/06 19:35:24
*************** extern int errorcount;
*** 89,94 ****
--- 89,98 ----
/* Front-end specific tree formatter, if non-NULL. */
printer_fn lang_printer = NULL;
+ /* An output_buffer surrogate for stderr. */
+ static output_buffer global_output_buffer;
+ output_buffer *diagnostic_buffer = &global_output_buffer;
+
static int need_error_newline;
/* Function of last error message;
*************** void (*print_error_function) PARAMS ((co
*** 108,134 ****
/* Maximum characters per line in automatic line wrapping mode.
Zero means don't wrap lines. */
! static int output_maximum_width = 0;
/* Used to control every diagnostic message formatting. Front-ends should
call set_message_prefixing_rule to set up their politics. */
! static int current_prefixing_rule = DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE;
! /* Predicate. Return 1 if we're in automatic line wrapping mode. */
! static int
! doing_line_wrapping ()
{
! return output_maximum_width > 0;
}
! /* Set Maximum characters per line in automatic line wrapping mode. */
! void
! set_message_length (n)
! int n;
{
! output_maximum_width = n;
}
void
--- 112,141 ----
/* Maximum characters per line in automatic line wrapping mode.
Zero means don't wrap lines. */
! int diagnostic_message_length_per_line;
/* Used to control every diagnostic message formatting. Front-ends should
call set_message_prefixing_rule to set up their politics. */
! static int current_prefixing_rule;
! /* Initialize the diagnostic message outputting machinery. */
! void
! initialize_diagnostics ()
{
! /* By default, we don't line-wrap messages. */
! diagnostic_message_length_per_line = 0;
! set_message_prefixing_rule (DIAGNOSTICS_SHOW_PREFIX_ONCE);
! /* Proceed to actual initialization. */
! default_initialize_buffer (diagnostic_buffer);
}
! /* Predicate. Return 1 if we're in automatic line wrapping mode. */
! static int
! doing_line_wrapping ()
{
! return diagnostic_message_length_per_line > 0;
}
void
*************** output_is_line_wrapping (buffer)
*** 147,153 ****
}
/* Return BUFFER's prefix. */
! char *
output_get_prefix (buffer)
const output_buffer *buffer;
{
--- 154,160 ----
}
/* Return BUFFER's prefix. */
! const char *
output_get_prefix (buffer)
const output_buffer *buffer;
{
*************** output_set_maximum_length (buffer, lengt
*** 190,208 ****
void
output_set_prefix (buffer, prefix)
output_buffer *buffer;
! char *prefix;
{
buffer->prefix = prefix;
set_real_maximum_length (buffer);
buffer->emitted_prefix_p = 0;
}
/* Construct an output BUFFER with PREFIX and of MAXIMUM_LENGTH
characters per line. */
void
init_output_buffer (buffer, prefix, maximum_length)
output_buffer *buffer;
! char *prefix;
int maximum_length;
{
obstack_init (&buffer->obstack);
--- 197,228 ----
void
output_set_prefix (buffer, prefix)
output_buffer *buffer;
! const char *prefix;
{
buffer->prefix = prefix;
set_real_maximum_length (buffer);
buffer->emitted_prefix_p = 0;
}
+ /* Free BUFFER's prefix, a previously malloc()'d string. */
+
+ void
+ output_destroy_prefix (buffer)
+ output_buffer *buffer;
+ {
+ if (buffer->prefix)
+ {
+ free ((char *) buffer->prefix);
+ buffer->prefix = NULL;
+ }
+ }
+
/* Construct an output BUFFER with PREFIX and of MAXIMUM_LENGTH
characters per line. */
void
init_output_buffer (buffer, prefix, maximum_length)
output_buffer *buffer;
! const char *prefix;
int maximum_length;
{
obstack_init (&buffer->obstack);
*************** init_output_buffer (buffer, prefix, maxi
*** 215,220 ****
--- 235,259 ----
buffer->cursor = NULL;
}
+ /* Initialize BUFFER with a NULL prefix and current diagnostic message
+ length cutoff. */
+ void
+ default_initialize_buffer (buffer)
+ output_buffer *buffer;
+ {
+ init_output_buffer (buffer, NULL, diagnostic_message_length_per_line);
+ }
+
+ /* Recompute diagnostic_buffer's attributes to reflect any change
+ in diagnostic formatting global options. */
+ void
+ reshape_diagnostic_buffer ()
+ {
+ diagnostic_buffer->ideal_maximum_length = diagnostic_message_length_per_line;
+ diagnostic_buffer->prefixing_rule = current_prefixing_rule;
+ set_real_maximum_length (diagnostic_buffer);
+ }
+
/* Reinitialize BUFFER. */
void
output_clear (buffer)
*************** output_clear (buffer)
*** 223,228 ****
--- 262,268 ----
obstack_free (&buffer->obstack, obstack_base (&buffer->obstack));
buffer->line_length = 0;
buffer->cursor = NULL;
+ buffer->emitted_prefix_p = 0;
}
/* Finishes to construct a NULL-terminated character string representing
*************** line_wrapper_printf VPARAMS ((FILE *file
*** 541,547 ****
#endif
output_buffer buffer;
! init_output_buffer (&buffer, NULL, output_maximum_width);
VA_START (buffer.format_args, msgid);
#ifndef ANSI_PROTOTYPES
--- 581,587 ----
#endif
output_buffer buffer;
! init_output_buffer (&buffer, NULL, diagnostic_message_length_per_line);
VA_START (buffer.format_args, msgid);
#ifndef ANSI_PROTOTYPES
*************** vline_wrapper_message_with_location (fil
*** 567,578 ****
output_buffer buffer;
init_output_buffer (&buffer, build_location_prefix (file, line, warn),
! output_maximum_width);
va_copy (buffer.format_args, ap);
output_notice (&buffer, msgid);
output_flush_on (&buffer, stderr);
! free (output_get_prefix (&buffer));
fputc ('\n', stderr);
}
--- 607,618 ----
output_buffer buffer;
init_output_buffer (&buffer, build_location_prefix (file, line, warn),
! diagnostic_message_length_per_line);
va_copy (buffer.format_args, ap);
output_notice (&buffer, msgid);
output_flush_on (&buffer, stderr);
! output_destroy_prefix (&buffer);
fputc ('\n', stderr);
}
*************** v_message_with_decl (decl, warn, msgid,
*** 657,663 ****
init_output_buffer
(&buffer, build_location_prefix
(DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl), warn),
! output_maximum_width);
}
else
report_file_and_line (DECL_SOURCE_FILE (decl),
--- 697,703 ----
init_output_buffer
(&buffer, build_location_prefix
(DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl), warn),
! diagnostic_message_length_per_line);
}
else
report_file_and_line (DECL_SOURCE_FILE (decl),
*************** v_message_with_decl (decl, warn, msgid,
*** 720,726 ****
if (doing_line_wrapping())
{
output_flush_on (&buffer, stderr);
! free (output_get_prefix (&buffer));
}
fputc ('\n', stderr);
--- 760,766 ----
if (doing_line_wrapping())
{
output_flush_on (&buffer, stderr);
! output_destroy_prefix (&buffer);
}
fputc ('\n', stderr);
*************** default_print_error_function (file)
*** 1176,1182 ****
prefix = build_message_string ("%s: ", file);
if (doing_line_wrapping ())
! init_output_buffer (&buffer, prefix, output_maximum_width);
else
{
if (file)
--- 1216,1223 ----
prefix = build_message_string ("%s: ", file);
if (doing_line_wrapping ())
! init_output_buffer
! (&buffer, prefix, diagnostic_message_length_per_line);
else
{
if (file)
Index: invoke.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/invoke.texi,v
retrieving revision 1.193
diff -p -r1.193 invoke.texi
*** invoke.texi 2000/05/31 19:27:09 1.193
--- invoke.texi 2000/06/06 19:35:26
*************** only one of these two forms, whichever o
*** 59,64 ****
--- 59,66 ----
* Invoking G++:: Compiling C++ programs.
* C Dialect Options:: Controlling the variant of C language compiled.
* C++ Dialect Options:: Variations on C++.
+ * Language Independent Options:: Controlling how diagnostics should be
+ formatted.
* Warning Options:: How picky should the compiler be?
* Debugging Options:: Symbol tables, measurements, and debugging dumps.
* Optimize Options:: How much optimization?
*************** in the following sections.
*** 116,121 ****
--- 118,130 ----
-Wsign-promo -Wsynth
@end smallexample
+ @item Language Independent Options
+ @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
+ @smallexample
+ -fmessage-length=@var{n}
+ -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}
+ @end smallexample
+
@item Warning Options
@xref{Warning Options,,Options to Request or Suppress Warnings}.
@smallexample
*************** in the following sections.
*** 467,472 ****
--- 476,483 ----
or preprocessed source.
* C Dialect Options:: Controlling the variant of C language compiled.
* C++ Dialect Options:: Variations on C++.
+ * Language Independent Options:: Controlling how diagnostics should be
+ formatted.
* Warning Options:: How picky should the compiler be?
* Debugging Options:: Symbol tables, measurements, and debugging dumps.
* Optimize Options:: How much optimization?
*************** This flag is not useful when compiling w
*** 1120,1131 ****
Like all options that change the ABI, all C++ code, @emph{including
libgcc} must be built with the same setting of this option.
- @item -fmessage-length=@var{n}
- Try to format error messages so that they fit on lines of about @var{n}
- characters. The default is 72 characters. If @var{n} is zero, then no
- line-wrapping will be done; each error message will appear on a single
- line.
-
@item -fno-implicit-templates
Never emit code for non-inline templates which are instantiated
implicitly (i.e. by use); only emit code for explicit instantiations.
--- 1131,1136 ----
*************** main ()
*** 1365,1370 ****
--- 1370,1413 ----
In this example, g++ will synthesize a default @samp{A& operator =
(const A&);}, while cfront will use the user-defined @samp{operator =}.
+ @end table
+
+ @node Language Independent Options
+ @section Options to Control Diagnostic Messages Formatting
+ @cindex options to control diagnostics formatting
+ @cindex diagnostic messages
+ @cindex message formatting
+
+ Traditionally, diagnostic messages have been formatted irrespetive of
+ the output device's aspect (e.g. its width, ...). The options described
+ below can be used to control the diagnostic messages formatting
+ algorithm, e.g. how many characters per line, how often source location
+ information should be reported. Right now, only the C++ front-end can
+ honor these options. However it is expected, in the near future, that
+ the remaining front-ends would be able to digest them correctly.
+
+ @table @code
+ @item -fmessage-length=@var{n}
+ Try to format error messages so that they fit on lines of about @var{n}
+ characters. The default is 72 characters for g++ and 0 for the rest of
+ the front-ends supported by GCC. If @var{n} is zero, then no
+ line-wrapping will be done; each error message will appear on a single
+ line.
+
+ @item -fdiagnostics-show-location=once
+ Only meaningful in line-wrapping mode. Intructs the diagnostic messages
+ reporter to emit @emph{once} source location information; that is, in
+ case the message is too long to fit on a single physical line and has to
+ be wrapped, the source location won't be emitted (as prefix) again,
+ over and over, in subsequent continuation lines. This is the default
+ behaviour.
+
+ @item -fdiagnostics-show-location=every-line
+ Only meaningful in line-wrapping mode. Instructs the diagnostic
+ messages reporter to emit the same source location information (as
+ prefix) for physical lines that result from the process of breaking a
+ a message which is too long to fit on a signe line.
+
@end table
@node Warning Options
Index: cp/Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/Makefile.in,v
retrieving revision 1.87
diff -p -r1.87 Makefile.in
*** Makefile.in 2000/06/04 21:12:26 1.87
--- Makefile.in 2000/06/06 19:35:26
*************** lex.o : lex.c $(CXX_TREE_H) \
*** 254,260 ****
$(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h \
$(srcdir)/../c-pragma.h $(srcdir)/../toplev.h \
$(srcdir)/../output.h $(srcdir)/../mbchar.h $(GGC_H) \
! $(srcdir)/../input.h operators.def
decl.o : decl.c $(CXX_TREE_H) $(srcdir)/../flags.h \
lex.h decl.h $(srcdir)/../stack.h $(srcdir)/../output.h $(srcdir)/../expr.h \
$(srcdir)/../except.h $(srcdir)/../toplev.h \
--- 254,260 ----
$(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h \
$(srcdir)/../c-pragma.h $(srcdir)/../toplev.h \
$(srcdir)/../output.h $(srcdir)/../mbchar.h $(GGC_H) \
! $(srcdir)/../input.h $(srcdir)/../diagnostic.h operators.def
decl.o : decl.c $(CXX_TREE_H) $(srcdir)/../flags.h \
lex.h decl.h $(srcdir)/../stack.h $(srcdir)/../output.h $(srcdir)/../expr.h \
$(srcdir)/../except.h $(srcdir)/../toplev.h \
Index: cp/lang-options.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/lang-options.h,v
retrieving revision 1.35
diff -p -r1.35 lang-options.h
*** lang-options.h 2000/05/14 08:44:48 1.35
--- lang-options.h 2000/06/06 19:35:26
*************** DEFINE_LANG_NAME ("C++")
*** 74,81 ****
{ "-flabels-ok", "Labels can be used as first class objects" },
{ "-fno-labels-ok", "" },
{ "-fmemoize-lookups", "" },
- { "-fmessage-length=", "" },
- { "-fdiagnostics-show-location=", "" },
{ "-fno-memoize-lookups", "" },
{ "-fms-extensions", "Don't pedwarn about uses of Microsoft extensions" },
{ "-fno-ms-extensions", "" },
--- 74,79 ----
Index: cp/lex.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/lex.c,v
retrieving revision 1.200
diff -p -r1.200 lex.c
*** lex.c 2000/06/06 00:12:40 1.200
--- lex.c 2000/06/06 19:35:27
*************** lang_init_options ()
*** 392,398 ****
/* Mark as "unspecified". */
flag_bounds_check = -1;
/* By default wrap lines at 72 characters. */
! set_message_length (72);
/* By default, emit location information once for every
diagnostic message. */
set_message_prefixing_rule (DIAGNOSTICS_SHOW_PREFIX_ONCE);
--- 392,398 ----
/* Mark as "unspecified". */
flag_bounds_check = -1;
/* By default wrap lines at 72 characters. */
! diagnostic_message_length_per_line = 72;
/* By default, emit location information once for every
diagnostic message. */
set_message_prefixing_rule (DIAGNOSTICS_SHOW_PREFIX_ONCE);
Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.362
diff -p -r1.362 decl2.c
*** decl2.c 2000/06/06 00:12:40 1.362
--- decl2.c 2000/06/06 19:35:28
*************** Boston, MA 02111-1307, USA. */
*** 45,51 ****
#include "dwarfout.h"
#include "ggc.h"
#include "timevar.h"
- #include "diagnostic.h"
#if USE_CPPLIB
#include "cpplib.h"
--- 45,50 ----
*************** lang_decode_option (argc, argv)
*** 678,698 ****
= skip_leading_substring (p, "name-mangling-version-")))
name_mangling_version
= read_integral_parameter (option_value, p - 2, name_mangling_version);
- else if ((option_value
- = skip_leading_substring (p, "message-length=")))
- set_message_length
- (read_integral_parameter (option_value, p - 2,
- /* default line-wrap length */ 72));
- else if ((option_value
- = skip_leading_substring (p, "diagnostics-show-location=")))
- {
- if (!strcmp (option_value, "once"))
- set_message_prefixing_rule (DIAGNOSTICS_SHOW_PREFIX_ONCE);
- else if (!strcmp (option_value, "every-line"))
- set_message_prefixing_rule (DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE);
- else
- error ("Unrecognized option `%s'", p - 2);
- }
else if ((option_value
= skip_leading_substring (p, "dump-translation-unit-")))
{
--- 677,682 ----
More information about the Gcc-patches
mailing list