This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ PATCH: document -fmessage-length



This patch documents Gaby's work on -fmessage-length, and also fixes a
bug in the way the default was being set.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2000-02-17  Mark Mitchell  <mark@codesourcery.com>

	* invoke.texi (-fmessage-length=n): Document.

Index: invoke.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/invoke.texi,v
retrieving revision 1.169
diff -c -p -r1.169 invoke.texi
*** invoke.texi	2000/02/14 22:56:20	1.169
--- invoke.texi	2000/02/17 20:33:02
*************** This flag is not useful when compiling w
*** 1126,1131 ****
--- 1126,1137 ----
  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 deafult is 72 characters.  If @var{n} is zero, then to
+ 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.

2000-02-17  Mark Mitchell  <mark@codesourcery.com>

	* decl2.c (lang_decode_option): Don't set default message length
	here.
	* lex.c (lang_init_options): Set it here.

Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.307
diff -c -p -r1.307 decl2.c
*** decl2.c	2000/02/16 23:54:22	1.307
--- decl2.c	2000/02/17 20:33:06
*************** lang_decode_option (argc, argv)
*** 570,578 ****
    strings_processed = 0;
  #endif /* ! USE_CPPLIB */
  
-   /* Enable automatic line wrapping by default */
-   set_message_length (72);
- 
    if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
      /* ignore */;
    else if (p[0] == '-' && p[1] == 'f')
--- 570,575 ----
*************** lang_decode_option (argc, argv)
*** 636,644 ****
  	name_mangling_version 
  	  = read_integral_parameter (p + 22, p - 2, name_mangling_version);
        else if (!strncmp (p, "message-length=", 15))
!           set_message_length
!               (read_integral_parameter (p + 15, p -2,
!                                         /* default line-wrap length */ 72));
        else if (!strncmp (p, "dump-translation-unit-", 22))
  	{
  	  if (p[22] == '\0')
--- 633,641 ----
  	name_mangling_version 
  	  = read_integral_parameter (p + 22, p - 2, name_mangling_version);
        else if (!strncmp (p, "message-length=", 15))
! 	set_message_length
! 	  (read_integral_parameter (p + 15, p - 2,
! 				    /* default line-wrap length */ 72));
        else if (!strncmp (p, "dump-translation-unit-", 22))
  	{
  	  if (p[22] == '\0')
Index: cp/lex.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/lex.c,v
retrieving revision 1.176
diff -c -p -r1.176 lex.c
*** lex.c	2000/02/16 23:54:22	1.176
--- lex.c	2000/02/17 20:33:11
*************** lang_init_options ()
*** 446,451 ****
--- 446,453 ----
    flag_exceptions = 1;
    /* Mark as "unspecified".  */
    flag_bounds_check = -1;
+   /* By default wrap lines at 72 characters.  */
+   set_message_length (72);
  }
  
  void

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]