[incremental] Patch: FYI: disable server mode for stdin compiles

Tom Tromey tromey@redhat.com
Mon Mar 31 18:11:00 GMT 2008


I'm checking this in on the incremental-compiler branch.

The compile server doesn't work properly if input is from stdin.
While this is fixable, I think there isn't much point -- so in this
case we just disable the server connection.

Tom

ChangeLog:
2008-03-31  Tom Tromey  <tromey@redhat.com>

	* gcc.c (main): Disable server if input comes from stdin.

Index: gcc.c
===================================================================
--- gcc.c	(revision 132956)
+++ gcc.c	(working copy)
@@ -6628,6 +6628,12 @@
 						   strlen (name),
 						   infiles[i].language);
 
+      /* Can't use the server when compiling stdin.  We could write to
+	 a temporary file, but it isn't worth the effort -- ordinarily
+	 stdin is only used for scratch compilations.  */
+      if (use_server && !strcmp (name, "-"))
+	use_server = false;
+
       if (compiler && !(compiler->combinable))
 	combine_inputs = false;
 



More information about the Gcc-patches mailing list