Bug 16128 – zlib version should not be hardcoded in etc.c.zlib

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-06-05T18:15:19Z
Last change time
2024-12-01T16:27:02Z
Assigned to
No Owner
Creator
Joseph Rushton Wakeling
Moved to GitHub: phobos#10181 →

Comments

Comment #0 by joseph.wakeling — 2016-06-05T18:15:19Z
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 by robert.schadek — 2024-12-01T16:27:02Z
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