This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Prototype for getopt in system.h
- To: "gcc-bugs at gcc dot gnu dot org" <gcc-bugs at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Subject: Re: PATCH: Prototype for getopt in system.h
- From: "Kelley Cook" <Kelley dot Cook at home dot com>
- Date: Wed, 29 Nov 2000 14:12:08 -0500
- Cc: "J. David Anglin" <dave dot anglin at nrc dot ca>
- Reply-To: "Kelley Cook" <Kelley dot Cook at home dot com>
J. David Anglin said:
>The following error occurs building under vax ultrix 4.3:
>
>stage1/xgcc -Bstage1/ -B/usr/local/vax-dec-ultrix4.3/bin/ -c -DIN_GCC -g -O3 -W -Wall -Wwrite-strings -Wstrict->prototypes -Wmissing-prototypes -DHAVE_CONFIG_H -I. -Ijava -I../../gcc -I../../gcc/java -I../../gcc/config ->I../../gcc/../include ../../gcc/java/gjavah.c -o java/gjavah.o
>../../include/getopt.h:111: conflicting types for `getopt'
>../../gcc/system.h:360: previous declaration of `getopt'
[ snip]
>--- system.h.orig Fri Nov 10 15:47:35 2000
>+++ system.h Sat Nov 18 15:57:01 2000
>@@ -357,7 +357,7 @@
> #endif
>
> #if defined (HAVE_DECL_GETOPT) && !HAVE_DECL_GETOPT
>-extern int getopt PARAMS ((int, char **, char *));
>+extern int getopt PARAMS ((int, char * const *, const char *));
> #endif
FWIW, this patch is also required for compiling CVS GCJ under Cygwin.
It would be nice if could be reviewed.
Kelley Cook