PATCH: Prototype for getopt in system.h
Kelley Cook
Kelley.Cook@home.com
Wed Nov 29 11:12:00 GMT 2000
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
More information about the Gcc-bugs
mailing list