Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zlib version should not be hardcoded in etc.c.zlib #10181

Open
dlangBugzillaToGithub opened this issue Jun 5, 2016 · 0 comments
Open

zlib version should not be hardcoded in etc.c.zlib #10181

dlangBugzillaToGithub opened this issue Jun 5, 2016 · 0 comments

Comments

@dlangBugzillaToGithub
Copy link

joseph.wakeling (@WebDrake) reported this on 2016-06-05T18:15:19Z

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

Description

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
@thewilsonator thewilsonator removed OS:Linux Issues specific to Linux Arch:x86_64 Issues specific to x86_64 P4 labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants