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]

PATCH: Prototype for getopt in system.h


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'

The prototype for getopt in system.h is missing `const' from the declarations
for the second and third arguments.  As a result, the two declarations are
inconsistent.

The base for this patch is system.h as patched in
<http://gcc.gnu.org/ml/gcc-patches/2000-10/msg00620.html>.  Unless the
prior patch is installed there will be a conflict.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2000-11-18  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* system.h: Correct prototype for getopt().

--- 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
 
 #if defined (HAVE_DECL_PUTENV) && !HAVE_DECL_PUTENV

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