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 PR 14356


My change to make GCC issue errors about modifications to const
variables broke the Cygwin bootstrap -- because there was buggy code
in gcc.c!

This patch should fix it.  Committed as obvious on the 3.4 branch and
on the mainline.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

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

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

Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.403.4.3
diff -c -5 -p -r1.403.4.3 gcc.c
*** gcc.c	20 Feb 2004 06:47:11 -0000	1.403.4.3
--- gcc.c	2 Mar 2004 05:53:38 -0000
*************** static void pfatal_pexecute (const char 
*** 338,348 ****
  static void notice (const char *, ...) ATTRIBUTE_PRINTF_1;
  static void display_help (void);
  static void add_preprocessor_option (const char *, int);
  static void add_assembler_option (const char *, int);
  static void add_linker_option (const char *, int);
! static void process_command (int, const char *const *);
  static int execute (void);
  static void alloc_args (void);
  static void clear_args (void);
  static void fatal_error (int);
  #ifdef ENABLE_SHARED_LIBGCC
--- 338,348 ----
  static void notice (const char *, ...) ATTRIBUTE_PRINTF_1;
  static void display_help (void);
  static void add_preprocessor_option (const char *, int);
  static void add_assembler_option (const char *, int);
  static void add_linker_option (const char *, int);
! static void process_command (int, const char **);
  static int execute (void);
  static void alloc_args (void);
  static void clear_args (void);
  static void fatal_error (int);
  #ifdef ENABLE_SHARED_LIBGCC
*************** add_linker_option (const char *option, i
*** 3072,3082 ****
  
  /* Create the vector `switches' and its contents.
     Store its length in `n_switches'.  */
  
  static void
! process_command (int argc, const char *const *argv)
  {
    int i;
    const char *temp;
    char *temp1;
    const char *spec_lang = 0;
--- 3072,3082 ----
  
  /* Create the vector `switches' and its contents.
     Store its length in `n_switches'.  */
  
  static void
! process_command (int argc, const char **argv)
  {
    int i;
    const char *temp;
    char *temp1;
    const char *spec_lang = 0;
*************** process_command (int argc, const char *c
*** 3310,3323 ****
  	    endp++;
  	}
      }
  
    /* Convert new-style -- options to old-style.  */
!   translate_options (&argc, &argv);
  
    /* Do language-specific adjustment/addition of flags.  */
!   lang_specific_driver (&argc, &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.
       Here we also parse the switches that cc itself uses (e.g. -v).  */
  
--- 3310,3323 ----
  	    endp++;
  	}
      }
  
    /* Convert new-style -- options to old-style.  */
!   translate_options (&argc, (const char *const **) &argv);
  
    /* Do language-specific adjustment/addition of flags.  */
!   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.
       Here we also parse the switches that cc itself uses (e.g. -v).  */
  
*************** fatal_error (int signum)
*** 5900,5913 ****
    /* Get the same signal again, this time not handled,
       so its normal effect occurs.  */
    kill (getpid (), signum);
  }
  
! extern int main (int, const char *const *);
  
  int
! main (int argc, const char *const *argv)
  {
    size_t i;
    int value;
    int linker_was_run = 0;
    int num_linker_inputs = 0;
--- 5900,5913 ----
    /* Get the same signal again, this time not handled,
       so its normal effect occurs.  */
    kill (getpid (), signum);
  }
  
! extern int main (int, const char **);
  
  int
! main (int argc, const char **argv)
  {
    size_t i;
    int value;
    int linker_was_run = 0;
    int num_linker_inputs = 0;


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