[Zlib-devel] Allow read-only data as input

Lasse Collin lasse.collin at tukaani.org
Wed Mar 30 09:18:16 EDT 2011


On 2011-03-29 Cosmin Truta wrote:
> There should be no issues, neither with source compatibility, nor
> with binary compatibility.

It does affect source compatibility. I don't have an idea how many 
packages would be affected. I checked six packages and two of them would 
need to be fixed (but maybe I had bad luck):

    // From Links 2.3pre1
    unsigned char *head = z.next_in;

    // From Boost 1.46.1
    // http://www.boost.org/doc/libs/1_46_1/libs/iostreams/src/zlib.cpp
    char* next_in = reinterpret_cast<char*>(s->next_in);

I think the ZLIB_CONST #define would be the best solution. Old packages 
will keep working and new programs can easily get const-correct 
z_stream.

-- 
Lasse Collin  |  IRC: Larhzu @ IRCnet & Freenode




More information about the Zlib-devel mailing list