Skip to content

HTS_USEZLIB guards are unreachable now that zlib is mandatory #751

Description

@xroche

Now that configure rejects --without-zlib and htsglobal.h rejects a -DHTS_USEZLIB=0 override (#750, and before it htsback.c's own #error), HTS_USEZLIB can only ever be 1. The ten surviving #if HTS_USEZLIB guards are therefore dead-true, plus the HTS_USEZLIB ? ... : HTS_CODEC_UNSUPPORTED ternary in htscodec.c. They read as though the build were still configurable when it is not.

Worth noting before deleting them: htscodec.c's #else arms are not stubs, they are a written zlib-free content-coding path (Accept-Encoding: identity, hts_codec_unpack returning -1). If a zlib-free build is ever wanted again, that half is done and the cache is the part that is not: htscache.c and proxy/store.c reach minizip from roughly 60 call sites with no null backend behind them.

One site is inconsistent regardless: htsweb.c:227 tests #ifdef HTS_USEZLIB where every other site uses #if. Since the macro is always defined, that guard has always been true whatever its value.

Blocked for now on #718, which holds htslib.c and htsselftest.c.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions