Issue 16128 - zlib version should not be hardcoded in etc.c.zlib
Summary: zlib version should not be hardcoded in etc.c.zlib
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86_64 Linux
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-05 18:15 UTC by Joseph Rushton Wakeling
Modified: 2024-12-01 16:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Joseph Rushton Wakeling 2016-06-05 18:15:19 UTC
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
Comment 1 dlangBugzillaToGithub 2024-12-01 16:27:02 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/10181

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB