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]

[PATCH] Fix error in option handling


The compiler driver accepts specific argument (e.g. `-v') as an option
for the compiler driver itself even if the argument immediately
follows -Xassembler or -Xpreprocessor.

The following patch fixes this problem.

MURAKAMI Kiyoshi


2007-07-14  MURAKAMI Kiyoshi  <murakami@za.bb-east.ne.jp>

	* gcc.c (process_command): Skip the argument immediately following
	-Xassembler or -Xpreprocessor.

	* gcc.c (process_command): Remove redundant code.

Index: gcc.c
===================================================================
--- gcc.c       (revision 126617)
+++ gcc.c       (working copy)
@@ -3713,6 +3713,7 @@ warranty; not even for MERCHANTABILITY o
            fatal ("argument to '-Xpreprocessor' is missing");
 
          add_preprocessor_option (argv[i+1], strlen (argv[i+1]));
+         i++;
        }
       else if (strcmp (argv[i], "-Xassembler") == 0)
        {
@@ -3720,6 +3721,7 @@ warranty; not even for MERCHANTABILITY o
            fatal ("argument to '-Xassembler' is missing");
 
          add_assembler_option (argv[i+1], strlen (argv[i+1]));
+         i++;
        }
       else if (strcmp (argv[i], "-l") == 0)
        {
@@ -3960,8 +3962,7 @@ warranty; not even for MERCHANTABILITY o
   if (save_temps_flag && use_pipes)
     {
       /* -save-temps overrides -pipe, so that temp files are produced */
-      if (save_temps_flag)
-       error ("warning: -pipe ignored because -save-temps specified");
+      error ("warning: -pipe ignored because -save-temps specified");
       use_pipes = 0;
     }


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