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]

Patch to argument processing in main


Complaining about options for another language causes problems with
collect2, which calls the C frontend with whatever arguments were passed to
the gcc command line, so

  g++ -fnew-abi wubba.C

would complain about compiling the collect-generated C file with -fnew-abi,
which is meaningless to the C frontend.  We could just fix this case, but
there are other cases where it would be convenient to be able to compile
code from multiple languages with the same set of flags (gcc -fwierd-stuff
foo.C bar.java baz.f), so I think the error should just be backed out.

Thu Oct 14 13:54:25 1999  Jason Merrill  <jason@yorick.cygnus.com>

	* toplev.c (main): Don't complain about options for other languages.

Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.237
diff -c -p -r1.237 toplev.c
*** toplev.c	1999/10/09 19:47:18	1.237
--- toplev.c	1999/10/14 22:08:21
*************** main (argc, argv)
*** 5387,5401 ****
  	 only be decoded in a language independent way if the were not
  	 decoded in a langauge specific way, which is why 'lang_processed'
  	 is passed in.  */
!       indep_processed = independent_decode_option (argc - i, argv + i, lang_processed);
  
        if (lang_processed || indep_processed)
! 	i += lang_processed > indep_processed ? lang_processed : indep_processed;
        else
! 	{
! 	  error ("Invalid option `%s'", argv[i]);
! 	  i++;
! 	}
      }
  
    /* Checker uses the frame pointer.  */
--- 5387,5401 ----
  	 only be decoded in a language independent way if the were not
  	 decoded in a langauge specific way, which is why 'lang_processed'
  	 is passed in.  */
!       indep_processed = independent_decode_option (argc - i, argv + i,
! 						   lang_processed);
  
        if (lang_processed || indep_processed)
! 	i += (lang_processed > indep_processed
! 	      ? lang_processed : indep_processed);
        else
! 	/* This option applies to some other language; ignore it.  *
! 	i++;
      }
  
    /* Checker uses the frame pointer.  */


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