PING PATCH: break lines in announce_function

Basile Starynkevitch basile@starynkevitch.net
Wed May 16 13:18:00 GMT 2012


On Wed, May 16, 2012 at 03:02:39PM +0200, Richard Guenther wrote:
> On Wed, May 16, 2012 at 2:46 PM, Basile Starynkevitch
> <basile@starynkevitch.net> wrote:
> > Hello All,
> >
> > I am pinging the patch http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00474.html
> > below for trunk svn 187587

--- gcc/toplev.c	(revision 187587)
+++ gcc/toplev.c	(working copy)
@@ -229,6 +229,11 @@ announce_function (tree decl)
 {
   if (!quiet_flag)
     {
+      static long count;
+      count++;
+      if (count % 8 == 0)
+        putc('\n', stderr);
+
       if (rtl_dump_and_exit)
 	fprintf (stderr, "%s ",
 		 identifier_to_locale (IDENTIFIER_POINTER (DECL_NAME (decl))));


> So - why?  I like it the way it is.

Because, as I explained in  http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00474.html without that patch 
you have arbitrarily long output lines, and that is unpleasant, in particular when running under gdb 
or under emacs (also, there may be buffering issues: if GCC misbehave, stderr might not be flushed 
often enough...)

The announce_function is quite rarely really used (because quiet_flag is almost always true), 
and it is used mostly to debug GCC (or plugins), and in that case having not too large output 
is quite useful in practice. The patch above is quick & dirty but seems enough.
Do you want me to add a comment like /* Hack to avoid very large output lines.  */ before?

Regards.


-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***



More information about the Gcc-patches mailing list