[Zlib-devel] zlib 1.2.7.1

Juergen Daubert juergen.daubert at gmx.net
Sun Apr 14 04:58:10 EDT 2013


On Sat, Apr 13, 2013 at 07:29:02PM -0700, Mark Adler wrote:
> On Apr 3, 2013, at 8:36 AM, Juergen Daubert <juergen.daubert at gmx.net> wrote:
> > found the following issue while building firefox version 20 and version
> > 19.0.2 from sources, works with zlib 1.2.7 without issues:
> 
> Juergen,
> 
> I can't tell from your report what in zlib was even being used.  Can you dig into it a little to see why the warning/error was occurring?  Thanks.

Will try, even though I'm not a programmer ;)

The problem was introduced with your commit 
- Add #define ZLIB_CONST option to use const in the z_stream interface. 
  https://github.com/madler/zlib/commit/5ab9f47745fe9353291b217f705086b6070575d5

at mozilla-release/netwerk/cache/nsCacheEntryDescriptor.cpp line 959 we 
have a statement

   Bytef * saveNextIn = mZstream.next_in;

where mZstream is defined as z_stream in nsCacheEntryDescriptor.h.

zlib.h defines 
   z_const Bytef *next_in;

If I read zconf.h correct, z_const is const for C++ sources which
raises the error described in my initial mail. If I change the above
statement to

   const Bytef * saveNextIn = mZstream.next_in;

firefox compiles nsCacheEntryDescriptor.cpp just fine, but we have the 
next error in mozilla-release/modules/libjar/nsZipArchive.cpp line 999:

    buf = mZs.next_in;  

here mZs is of type t_stream and buf defined as uint8_t *buf = nullptr;
which raises the following error:

mozilla-release/modules/libjar/nsZipArchive.cpp:999:17: 
error: invalid conversion from 'const Bytef* {aka const unsigned char*}' to 
'uint8_t* {aka unsigned char*}' [-fpermissive]



Hope this helps and thanks
Juergen





More information about the Zlib-devel mailing list