Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 894598 - sys-libs/zlib: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x
Summary: sys-libs/zlib: error: a function definition without a prototype is deprecated...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH, UPSTREAM
Depends on:
Blocks: c23-porting
  Show dependency tree
 
Reported: 2023-02-15 15:29 UTC by Peter Levine
Modified: 2023-08-18 10:37 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
zlib-1.2.13-clang16.patch (zlib-1.2.13-clang16.patch,53.18 KB, patch)
2023-02-15 15:37 UTC, Peter Levine
Details | Diff
build.log (build.log,84.06 KB, text/x-log)
2023-02-15 15:39 UTC, Peter Levine
Details
emerge --info (emerge-info.txt,27.22 KB, text/plain)
2023-02-15 15:41 UTC, Peter Levine
Details

Note You need to log in before you can comment on or make changes to this bug.
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(+)