www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16128] New: zlib version should not be hardcoded in etc.c.zlib

https://issues.dlang.org/show_bug.cgi?id=16128

          Issue ID: 16128
           Summary: zlib version should not be hardcoded in etc.c.zlib
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: joseph.wakeling webdrake.net

The etc.c.zlib module includes hardcoded copies of 2 #define'd constants from
zlib.h:

    const char[] ZLIB_VERSION = "1.2.8";
    const ZLIB_VERNUM = 0x1280;

However, the builder (or user) of phobos has no guarantee that this is the
version installed on their system; and for libphobos packages built with
dynamic linking against zlib (as e.g. on Debian/Ubuntu), there is no guarantee
that the installed zlib version will not be upgraded.

It therefore seems dangerous/misleading to have these constants in the D
wrapper, unless it is to specify a minimum supported version of zlib.

If we assume/enforce static linking, then the version constants could be
autogenerated at build time, but this seems too strong an assumption given the
existing Debian/Ubuntu packaging situation.

Note also that these version constants are missing several of their C
header-defined equivalents:

    #define ZLIB_VERSION "1.2.8"
    #define ZLIB_VERNUM 0x1280
    #define ZLIB_VER_MAJOR 1
    #define ZLIB_VER_MINOR 2
    #define ZLIB_VER_REVISION 8
    #define ZLIB_VER_SUBREVISION 0

--
Jun 05 2016