List Archive


Thread Index


From: Dieter Baron <>
To: Boaz Stolk <>
Subject: Re: Seek error when libzip is compiled with CMake
Date: Mon, 25 Jan 2016 11:20:42 +0100

> On 22 Jan 2016, at 18:06 , Boaz Stolk <> wrote:
> Hi,
> I think I found the reason and a possible solution.
> zipconf.h defines ZIP_INT64_MIN as -0x8000000000000000LL, but comparing a 
> positive zip_int64_t for smaller than (<) ZIP_INT64_MIN always evaluates to 
> true!?

That sounds broken. Could you try the attached program? Compile it with the 
same compiler/flags that the cmake generated Makefile uses.

For me, it prints OK: 5 >= -9223372036854775808.

Also, can you send me the generated Makefile and config.h?


> This is exactly what is going on in _zip_fseek() at 
> If I cast ZIP_FSEEK_MIN to (zip_int64_t) here everything seems to work as 
> expected.
> I think it may be related to something like this: 
> I've also first tried your suggestion with largefile support, but that 
> doesn't fix it. Also if I remove the AC_SYS_LARGEFILE from and 
> recompile using configure generated Makefiles the issue doesn't occur. 
> However there must be a compiler setting, flag or generated file that is 
> different from cmake, I'm just not able to find it..
> This is the code I found on the Internet to define the appropriate 
>  (only the ac_sys_largefile function)
> Regards,
> Boaz
> -----Original Message-----
> From: Thomas Klausner [] 
> Sent: 20 January 2016 23:24
> To: Boaz Stolk
> Cc:
> Subject: Re: Seek error when libzip is compiled with CMake
> On Wed, Jan 20, 2016 at 03:42:25PM +0000, Boaz Stolk wrote:
>> I am encountering the following issue when libzip is compiled with the 
>> Makefiles that CMake has generated.
>> When I do a zip_fopen_index on an (successfully opened archive), 
>> zip_fopen_index returns NULL and the error is: Seek error: Value too large 
>> for defined data type.
>> Note that this does *not* occur when I build libzip using autoconf / 
>> configure.
>> System:
>> CentOS 6.6 (Final)
>> Kernel Linux 2.6.32-504.16.2.el6.x86_64
> The intention was to provide CMake for Windows and let the other systems that 
> can deal with it use the configure script, that's why you see problems like 
> this.
> In this particular case, I think autoconf is smart enough to test for various 
> #defines that might be necessary to get proper large file support (see 
> --enable-largefile). I think it tries _FILE_OFFSET_BITS and _LARGE_FILES. I 
> guess one or both might be needed on CentOS?
> If you are interested in this, perhaps you can come up with a patch for the 
> cmake files that checks for these as well?
> Thanks,
> Thomas
> --
> This message has been scanned for viruses and dangerous content by 
> MailScanner, and is believed to be clean.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Made by MHonArc.