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]

[3.2 PATCH] Fix cygwin bootstrap failure


This is a backport from mainline of the following patch
http://gcc.gnu.org/ml/gcc-patches/2002-10/msg01616.html

It looks like whichever change caused the original failure
on mainline, has now been applied to the 3.2 branch, so
this fix is now required there too.

The problem is that the prototype of "getopt" without any
arguments in libierty's getopt.h causes g++ to fail as this
conflicts with the full prototype given in the system headers.
The fix is effectively identical to that for mainline.

The patch below has been tested on the 3.2 branch by a complete
bootstrap (all languages except Ada and treelang) on i686-pc-linux-gnu
and on i686-pc-cgywin, where it fixes the current bootstrap
failure.

Ok for the gcc-3_2-branch?


2002-11-02  Roger Sayle  <roger@eyesopen.com>
	    DJ Delorie <dj@redhat.com>

	* getopt.h:  Avoid prototyping getopt with no arguments in C++.


Index: getopt.h
===================================================================
RCS file: /cvs/gcc/gcc/include/getopt.h,v
retrieving revision 1.6
diff -c -3 -p -r1.6 getopt.h
*** getopt.h	14 Mar 2001 19:44:38 -0000	1.6
--- getopt.h	2 Nov 2002 18:15:37 -0000
*************** struct option
*** 111,117 ****
     errors, only prototype getopt for the GNU C library.  */
  extern int getopt (int argc, char *const *argv, const char *shortopts);
  #else /* not __GNU_LIBRARY__ */
! # if !defined (HAVE_DECL_GETOPT)
  extern int getopt ();
  # endif
  #endif /* __GNU_LIBRARY__ */
--- 111,117 ----
     errors, only prototype getopt for the GNU C library.  */
  extern int getopt (int argc, char *const *argv, const char *shortopts);
  #else /* not __GNU_LIBRARY__ */
! # if !defined (HAVE_DECL_GETOPT) && !defined (__cplusplus)
  extern int getopt ();
  # endif
  #endif /* __GNU_LIBRARY__ */

Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


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