cph6 / zsync

zsync - rsync over http
203 stars 48 forks source link

Build error with GCC-14 #20

Open talau opened 3 months ago

talau commented 3 months ago

Hi there,

Using GCC-14 the program fails to build.

I fixed this on zsync-0.6.2. I tried to make a fork and merge, but I checked that the git version is not the 0.6.2. Anyway, I have attached the end of this message.

Regards, mt

Index: zsync-0.6.2/client.c

--- zsync-0.6.2.orig/client.c +++ zsync-0.6.2/client.c @@ -392,7 +392,7 @@ int fetch_remaining_blocks_http(struct z / int fetch_remaining_blocks(struct zsync_state zs) { int n, utype;

@@ -452,7 +452,7 @@ extern long global_offset; int main(int argc, char *argv) { struct zsync_state zs; char *temp_file = NULL;

Index: zsync-0.6.2/libzsync/zmap.h

--- zsync-0.6.2.orig/libzsync/zmap.h +++ zsync-0.6.2/libzsync/zmap.h @@ -29,7 +29,7 @@ struct zmap zmap_make(const struct gzbl void zmap_free(struct zmap);

off_t zmap_to_compressed_ranges(const struct zmap zm, off_t byterange, int nrange, int num); -void configure_zstream_for_zdata(const struct zmap zm, struct z_stream_s zs, long zoffset, long long poutoffset); +void configure_zstream_for_zdata(const struct zmap zm, struct z_stream_s zs, long zoffset, off_t poutoffset);

/ gzip flag byte /

define GZ_ASCII_FLAG 0x01 / bit 0 set: file probably ascii text /

Index: zsync-0.6.2/libzsync/zsync.c

--- zsync-0.6.2.orig/libzsync/zsync.c +++ zsync-0.6.2/libzsync/zsync.c @@ -436,7 +436,7 @@ void zsync_progress(const struct zsync_s

-const char const zsync_get_urls(struct zsync_state zs, int n, int* t); +char * zsync_get_urls(struct zsync_state zs, int n, int t);

/* zsync_needed_byte_ranges - get the byte ranges needed from a URL.

mwichmann commented 2 months ago

@talau can you either edit this to be surrounded by triple backquotes so GitHub's Markdown parser doesn't garble it, or, perhaps better, add the code as an attachment? I'm finding the same problem. The changes above aren't nearly enough for me, anyway - there are multiple incompatible-pointer-type errors, I had to build with -fpermissive.