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 cygwin bootstrap failure


The following patch restores mainline to bootstrap land on i686-pc-cygwin
which currently failures during stage2 with a fatal warning building gcc.c
complaining about casting "char **argv" to "const char * const *" for the
second argument to mingw_scan.

Given that mingw_scan is only called from a single place (gcc.c:main in
the expansion of GCC_DRIVER_HOST_INITIALIZATION) there are two possible
cures.  The minimal fix below is to simply cast argv to the appropriate
type required by mingw_scan.  The alternate fix (that touches two files)
is to change the signature of mingw_scan such that the second argument
is of type "char**" to match its only caller.  I've no strong preference
for one vs. the other, but the proposed solution below is both smaller
and reflects that mingw_scan doesn't internally modify its argv argument.

Ok for mainline?  Obvious?


2006-01-30  Roger Sayle  <roger@eyesopen.com>

	* config/i386/cygwin.h (GCC_DRIVER_HOST_INITIALIZATION): Cast
	argv to the appropriate type.


Index: cygwin.h
===================================================================
*** cygwin.h	(revision 110407)
--- cygwin.h	(working copy)
*************** void mingw_scan (int, const char * const
*** 204,210 ****
  #define GCC_DRIVER_HOST_INITIALIZATION \
  do \
  { \
!   mingw_scan(argc, argv, (char **) &spec_machine); \
    } \
  while (0)
  #else
--- 204,210 ----
  #define GCC_DRIVER_HOST_INITIALIZATION \
  do \
  { \
!   mingw_scan(argc, (const char * const *) argv, (char **) &spec_machine); \
    } \
  while (0)
  #else
*************** do \
*** 224,230 ****
    add_prefix (&startfile_prefixes,\
  	      concat (standard_startfile_prefix, "w32api", NULL),\
  	      "GCC", PREFIX_PRIORITY_LAST, 0, NULL);\
!   mingw_scan(argc, argv, &spec_machine); \
    } \
  while (0)
  #endif
--- 224,230 ----
    add_prefix (&startfile_prefixes,\
  	      concat (standard_startfile_prefix, "w32api", NULL),\
  	      "GCC", PREFIX_PRIORITY_LAST, 0, NULL);\
!   mingw_scan(argc, (const char * const *) argv, &spec_machine); \
    } \
  while (0)
  #endif

Roger
--


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