This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Java - allow compiling a compressed .jar/.zip archive
- To: Per Bothner <per at bothner dot com>
- Subject: Re: [PATCH] Java - allow compiling a compressed .jar/.zip archive
- From: Jeff Sturm <jeff dot sturm at appnet dot com>
- Date: Tue, 23 Jan 2001 01:59:27 -0500
- CC: java-discuss at sources dot redhat dot com, gcc-patches at gcc dot gnu dot org
- References: <m2wvbo1sac.fsf@kelso.bothner.com>
Per Bothner wrote:
> I checked in the following. It should allow compiling a compressed
> .jar or .zip archive.
I took another look at this patch:
> @@ -38,6 +42,7 @@ struct ZipDirectory {
> unsigned size; /* length of file */
> unsigned uncompressed_size; /* length of uncompressed data */
> unsigned filestart; /* start of file in archive */
> + ZipFile *zipf;
> int filename_length;
> /* char mid_padding[...]; */
> /* char filename[filename_length]; */
Here we change the size (and possibly alignment) of ZipDirectory.
Instances of "struct ZipDirectory" are not allocated but assigned to a
buffer offset in zextract.c:
320: ZipDirectory *zipd = (ZipDirectory*)(dir_ptr +
dir_last_pad);
The dir_ptr array contents are read directly from a zip file. I am very
skeptical that this is doing the right thing. We may have gotten by
prior to this patch because the size and alignment of ZipDirectory just
happened to be consistent on all GCC platforms, but introducing a
pointer to the struct changes that.
Are compressed jar files an essential feature for 3.0? I'm wondering if
this patch shouldn't be backed out until it can be studied some more.
Jeff