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]
Other format: [Raw text]

Fix --help --target-help duplication


toplev.c prints the target help twice if you pass both --help and
--target-help.

Fixed thus; bootstrapped and regression tested; I'll commit it to
mainline as obvious.

Neil.

	* toplev.c (display_target_options): Don't print twice.

Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.550
diff -u -p -r1.550 toplev.c
--- toplev.c	2001/12/02 14:38:07	1.550
+++ toplev.c	2001/12/04 23:28:47
@@ -3686,6 +3686,12 @@ static void
 display_target_options ()
 {
   int undoc,i;
+  static bool displayed = false;
+
+  /* Avoid double printing for --help --target-help.  */
+  if (displayed)
+    return;
+  displayed = true;
 
   if (ARRAY_SIZE (target_switches) > 1
 #ifdef TARGET_OPTIONS


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