Skip to content

Declare mz_version() even when MINIZ_NO_ZLIB_APIS is defined - #395

Merged
uroni merged 1 commit into
richgel999:masterfrom
akashdeshmukh-git:fix-mz-version-prototype
Nov 8, 2026
Merged

uroni merged 1 commit into
richgel999:masterfrom
akashdeshmukh-git:fix-mz-version-prototype

Conversation

@akashdeshmukh-git

Copy link
Copy Markdown
Contributor

Fixes #290.

mz_version() is always defined in miniz.c, but its prototype in miniz.h was inside the MINIZ_NO_ZLIB_APIS guard. With that option, -Wmissing-prototypes warns and there's no public declaration. This moves the prototype above the guard.

Checked with gcc -std=c99 -Wall -Wextra -Wmissing-prototypes, with and without MINIZ_NO_ZLIB_APIS: the mz_version warning is gone, nothing else changes

mz_version() is always defined in miniz.c, but its prototype in
miniz.h sat inside the MINIZ_NO_ZLIB_APIS guard, so builds with that
option got -Wmissing-prototypes warnings and no public declaration.
Move the prototype above the guard.

Fixes richgel999#290
@akashdeshmukh-git

Copy link
Copy Markdown
Contributor Author

Gentle ping — just checking if this has had a chance to be reviewed. This is a one-line header fix moving the mz_version() prototype above the MINIZ_NO_ZLIB_APIS guard to silence a -Wmissing-prototypes warning. Happy to rebase or adjust if needed.

@uroni
uroni merged commit d8ca37e into richgel999:master Nov 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mz_version() defined without prototype, causing warning, when MINIZ_NO_ZLIB_APIS defined

2 participants