fastjar/jargrep.c fails to compile under cygwin

R. Kelley Cook Kelley.Cook@home.com
Fri Dec 15 08:26:00 GMT 2000


In the current CVS fastjar/jargrep.c fails to compile under Cygwin.  
The error end of the make file is as follows.

gcc -DHAVE_CONFIG_H -I. -I/CVSTree/gcc/gcc/fastjar -I. -I. -I/CVSTree/gcc/gcc/fastjar -I/CVSTree/gcc/gcc/fastjar/../zlib   -W -Wall -pedantic -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -g -O2 -c /CVSTree/gcc/gcc/fastjar/jargrep.c
/CVSTree/gcc/gcc/fastjar/jargrep.c: In function `check_crc':
/CVSTree/gcc/gcc/fastjar/jargrep.c:439: warning: `crc' might be used uninitialized in this function
/CVSTree/gcc/gcc/fastjar/jargrep.c: In function `cont_grep':
/CVSTree/gcc/gcc/fastjar/jargrep.c:549: warning: `nl_offsets' might be used uninitialized in this function
/CVSTree/gcc/gcc/fastjar/jargrep.c: In function `main':
/CVSTree/gcc/gcc/fastjar/jargrep.c:643: warning: implicit declaration of function `getopt'
/CVSTree/gcc/gcc/fastjar/jargrep.c:684: `optind' undeclared (first use in this function)
/CVSTree/gcc/gcc/fastjar/jargrep.c:684: (Each undeclared identifier is reported only once
/CVSTree/gcc/gcc/fastjar/jargrep.c:684: for each function it appears in.)
/CVSTree/gcc/gcc/fastjar/jargrep.c:637: warning: `fileindex' might be used uninitialized in this function
make[2]: *** [jargrep.o] Error 1
make[2]: Leaving directory `/obj/testgcc/fastjar'
make[1]: *** [all-fastjar] Error 2
make[1]: Leaving directory `/obj/testgcc'
make: *** [bootstrap] Error 2

Simply adding '#include "getopt.h"' to this file seems to fix the
problem.

2000-12-14 Kelley Cook <kelleycook@home.com>

	* jargrep.c: Include getopt.h.

--- jargrep.c~  Fri Dec 15 08:21:35 2000
+++ jargrep.c   Fri Dec 15 11:16:34 2000
@@ -99,6 +99,7 @@ will test some other platforms later.
 #include "zipfile.h"
 #include "zlib.h"
 #include "compress.h"
+#include "getopt.h"

 #define Usage "Usage: %s [-bcinsw] <-e regexp | regexp> file(s)\n"





More information about the Gcc-patches mailing list