You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 0The text was updated successfully, but these errors were encountered: