This is the mail archive of the gcc@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]

Re: [PR bootstrap/14356] Error building 3.3.4 on i686-cygwin.


> ../../gcc/gcc/gcc.c: In function `process_command':
> ../../gcc/gcc/gcc.c:3609: error: assignment of read-only location
> ../../gcc/gcc/gcc.c:3611: error: assignment of read-only location
> make[2]: *** [gcc.o] Error 1

I hadn't tried CVS GCC 3.3 in a while, but I suspect that Mark Mitchell's patch to better diagnose constness was backported to GCC 3.3, which exposed a latent bug in gcc.c when it was ported to mainline and 3.4.

This became PR 14356

Anyway that was solved by: http://gcc.gnu.org/ml/gcc-patches/2004-03/msg00120.html which I would think should also now be backported to the GCC 3.3 branch.

Gaby,

Would this be OK if it passes an overnight bootstrap on i686-pc-cygwin?
It is different from Mark's patch as it had to be readjusted for K&R-ness.

Kelley Cook
2004-03-24  Kelley Cook  <kcook@gcc.gnu.org>

	Backport:
	2004-03-01  Mark Mitchell  <mark@codesourcery.com>

	PR bootstrap/14356
	* gcc.c (process_command): Remove const-qualification from argv.
	(main): Likewise.

--- gcc.c.orig	2004-03-12 19:45:39.000000000 -0500
+++ gcc.c	2004-03-24 17:12:33.237528000 -0500
@@ -328,7 +328,7 @@ static void display_help 	PARAMS ((void)
 static void add_preprocessor_option	PARAMS ((const char *, int));
 static void add_assembler_option	PARAMS ((const char *, int));
 static void add_linker_option		PARAMS ((const char *, int));
-static void process_command		PARAMS ((int, const char *const *));
+static void process_command		PARAMS ((int, const char **));
 static int execute			PARAMS ((void));
 static void alloc_args			PARAMS ((void));
 static void clear_args			PARAMS ((void));
@@ -3050,7 +3050,7 @@ add_linker_option (option, len)
 static void
 process_command (argc, argv)
      int argc;
-     const char *const *argv;
+     const char **argv;
 {
   int i;
   const char *temp;
@@ -3279,10 +3279,10 @@ process_command (argc, argv)
     }
 
   /* Convert new-style -- options to old-style.  */
-  translate_options (&argc, &argv);
+  translate_options (&argc, (const char *const **) &argv);
 
   /* Do language-specific adjustment/addition of flags.  */
-  lang_specific_driver (&argc, &argv, &added_libraries);
+  lang_specific_driver (&argc, (const char *const **) &argv, &added_libraries);
 
   /* Scan argv twice.  Here, the first time, just count how many switches
      there will be in their vector, and how many input files in theirs.
@@ -5917,12 +5917,12 @@ fatal_error (signum)
   kill (getpid (), signum);
 }
 
-extern int main PARAMS ((int, const char *const *));
+extern int main PARAMS ((int, const char **));
 
 int
 main (argc, argv)
      int argc;
-     const char *const *argv;
+     const char **argv;
 {
   size_t i;
   int value;

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