diff mbox

PATCH: break lines in announce_function

Message ID 20120210103447.GA5193@ours.starynkevitch.net
State New
Headers show

Commit Message

Basile Starynkevitch Feb. 10, 2012, 10:34 a.m. UTC
Hello All,

When running cc1 in verbose mode, the announce_function from gcc/toplevel.c
displays the name of the function. However, it never emits any newline
characters. As a result, the stderr stream may contains very long lines,
which is visually unpleasant and tend to block Emacs when running cc1 -v
inside an Emacs buffer (or agdb session inside Emacs).

The attached patch (backbported from the MELT branch, where it is very
useful) fixes this issue by adding a newline once every eight identifiers.

#### gcc/ChangeLog entry

2011-02-10  Basile Starynkevitch  <basile@starynkevitch.net>

	* toplev.c (announce_function): Emit newline periodically.


########################

Ok for trunk?

Thanks
diff mbox

Patch

Index: gcc/toplev.c
===================================================================
--- gcc/toplev.c	(revision 184084)
+++ gcc/toplev.c	(working copy)
@@ -234,6 +234,12 @@  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))));