Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 894598

Summary: sys-libs/zlib: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x
Product: Gentoo Linux Reporter: Peter Levine <plevine457>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: marc_heimann, plevine457
Priority: Normal Keywords: PATCH, UPSTREAM
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/madler/zlib/issues/633
https://github.com/madler/zlib/pull/779
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 880545    
Attachments: zlib-1.2.13-clang16.patch
build.log
emerge --info

Description Peter Levine 2023-02-15 15:29:26 UTC
Building with clang-16 fails with

> ../zlib-1.2.13/crc32.c:126:16: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
> local z_word_t byte_swap(word)
>                ^
Comment 1 Peter Levine 2023-02-15 15:35:21 UTC
Upstream PR: https://github.com/madler/zlib/pull/779
Comment 2 Peter Levine 2023-02-15 15:37:11 UTC
Created attachment 851250 [details, diff]
zlib-1.2.13-clang16.patch

Patch for ~zlib-1.2.13
Comment 3 Peter Levine 2023-02-15 15:39:35 UTC
Created attachment 851252 [details]
build.log
Comment 4 Peter Levine 2023-02-15 15:41:12 UTC
Created attachment 851254 [details]
emerge --info
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-16 01:17:59 UTC
Note that -Wdeprecated-non-prototype is not an error by default with Clang 16, I believe, just a warning.

>=sys-devel/clang-common-16[stricter] enables _stricter_ defaults than Clang 16 ships with. So, normally, to test for Clang 16 preparedness, people want either <sys-devel/clang-common-16[stricter] or >=sys-devel/clang-16.

But the bug is still valid, of course. It'll be broken when things switch to -std=c23 by default.
Comment 6 Larry the Git Cow gentoo-dev 2023-08-18 10:37:28 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7b87a81b27f0d176d42fcb96747e5ecc72d62c6

commit b7b87a81b27f0d176d42fcb96747e5ecc72d62c6
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-08-18 10:09:13 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-08-18 10:11:04 +0000

    sys-libs/zlib: add 1.3
    
    Closes: https://bugs.gentoo.org/894598
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-libs/zlib/Manifest        |   2 +
 sys-libs/zlib/zlib-1.3.ebuild | 185 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 187 insertions(+)