Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 880381 - dev-libs/libevent-2.1.12 - /.../strlcpy.c: error: a function definition without a prototype is deprecated in all versions of C and
Summary: dev-libs/libevent-2.1.12 - /.../strlcpy.c: error: a function definition witho...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: c23-porting
  Show dependency tree
 
Reported: 2022-11-08 10:24 UTC by Toralf Förster
Modified: 2023-05-02 20:50 UTC (History)
1 user (show)

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


Attachments
emerge-info.txt (emerge-info.txt,17.08 KB, text/plain)
2022-11-08 10:24 UTC, Toralf Förster
Details
clang.tar.bz2 (clang.tar.bz2,3.82 KB, application/x-bzip)
2022-11-08 10:24 UTC, Toralf Förster
Details
dev-libs:libevent-2.1.12:20221108-093257.log (dev-libs:libevent-2.1.12:20221108-093257.log,44.80 KB, text/plain)
2022-11-08 10:24 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,29.57 KB, text/plain)
2022-11-08 10:24 UTC, Toralf Förster
Details
environment (environment,77.95 KB, text/plain)
2022-11-08 10:24 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,22.66 KB, application/x-bzip)
2022-11-08 10:24 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,16.76 KB, application/x-bzip)
2022-11-08 10:24 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,29.61 KB, application/x-bzip)
2022-11-08 10:24 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2022-11-08 10:24:05 UTC
too long lines were shrinked:

/bin/sh ./libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I/var/tmp/portage/dev-libs/libevent-2.1.12/work/libevent-2.1.12-stable  -I/var/tmp/portage/dev-libs/libevent-2.1.12/work/libevent-2.1.12-stable/compat -I./include -I/var/tmp/portage/dev-libs/libevent-2.1.12/work/libevent-2.1.12-
2 warnings generated.
/bin/sh ./libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I/var/tmp/portage/dev-libs/libevent-2.1.12/work/libevent-2.1.12-stable  -I/var/tmp/portage/dev-libs/libevent-2.1.12/work/libevent-2.1.12-stable/compat -I./include -I/var/tmp/portage/dev-libs/libevent-2.1.12/work/libevent-2.1.12-
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I/var/tmp/portage/dev-libs/libevent-2.1.12/work/libevent-2.1.12-stable -I/var/tmp/portage/dev-libs/libevent-2.1.12/work/libevent-2.1.12-stable/compat -I./include -I/var/tmp/portage/dev-libs/libevent-2.1.12/work/libevent-2.1.12-stable/include -pipe -march
/var/tmp/portage/dev-libs/libevent-2.1.12/work/libevent-2.1.12-stable/strlcpy.c:48:1: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
event_strlcpy_(dst, src, siz)
^

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_no_multilib-j4-20221108-023017

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-12 *
clang/llvm (if any):
clang version 15.0.4
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/15/bin
Configuration file: /etc/clang/clang.cfg
/usr/lib/llvm/15
15.0.4
Python 3.10.8
Available Rust versions:
  [1]   rust-bin-1.64.0 *
The Glorious Glasgow Haskell Compilation System, version 8.10.6
php cli (if any):
GNU Make 4.4

  HEAD of ::gentoo
commit 5c62c228257b375a4680cb55f3573cbf3d80326c
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Tue Nov 8 09:01:56 2022 +0000

    2022-11-08 09:01:56 UTC

emerge -qpvO dev-libs/libevent
[ebuild  N    ] dev-libs/libevent-2.1.12  USE="clock-gettime ssl threads -debug -malloc-replacement -static-libs -test -verbose-debug"
Comment 1 Toralf Förster gentoo-dev 2022-11-08 10:24:06 UTC
Created attachment 829003 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2022-11-08 10:24:07 UTC
Created attachment 829005 [details]
clang.tar.bz2
Comment 3 Toralf Förster gentoo-dev 2022-11-08 10:24:08 UTC
Created attachment 829007 [details]
dev-libs:libevent-2.1.12:20221108-093257.log
Comment 4 Toralf Förster gentoo-dev 2022-11-08 10:24:09 UTC
Created attachment 829009 [details]
emerge-history.txt
Comment 5 Toralf Förster gentoo-dev 2022-11-08 10:24:11 UTC
Created attachment 829011 [details]
environment
Comment 6 Toralf Förster gentoo-dev 2022-11-08 10:24:12 UTC
Created attachment 829013 [details]
etc.portage.tar.bz2
Comment 7 Toralf Förster gentoo-dev 2022-11-08 10:24:13 UTC
Created attachment 829015 [details]
logs.tar.bz2
Comment 8 Toralf Förster gentoo-dev 2022-11-08 10:24:14 UTC
Created attachment 829017 [details]
temp.tar.bz2
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-02 17:13:44 UTC
orbea: ?
Comment 10 orbea 2023-05-02 17:55:53 UTC
@ Sam This is a strict-prototypes issue on clang + glibc systems, seems on my musl system the problematic code is never compiled.

Check out the fix.

https://github.com/libevent/libevent/commit/35375101e741d78bf49642c6929c1eb69a7c3d79
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-02 17:56:29 UTC
(In reply to orbea from comment #10)
> @ Sam This is a strict-prototypes issue on clang + glibc systems, seems on
> my musl system the problematic code is never compiled.
> 
> Check out the fix.
> 
> https://github.com/libevent/libevent/commit/
> 35375101e741d78bf49642c6929c1eb69a7c3d79

That means it's a C23 issue, it only becomes an error if a project build with -Werror?
Comment 12 orbea 2023-05-02 18:07:16 UTC
Perhaps I was confused which was which...

It doesn't error with gcc even with -Werror, but will fail with clang-16 even without -Werror when clang-common has USE=stricter.
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-02 18:11:57 UTC
(In reply to orbea from comment #12)
> Perhaps I was confused which was which...
> 
> It doesn't error with gcc even with -Werror, but will fail with clang-16
> even without -Werror when clang-common has USE=stricter.

Yeah, USE=stricter on >= clang-16 is *stricter* than the clang-16 default, so it enforces -Werror for stuff like this.
Comment 14 orbea 2023-05-02 18:17:10 UTC
Thank you for catching my mistake.
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-02 18:24:13 UTC
They still matter though of course, just wanted to make sure I wasn't missing something!
Comment 16 Larry the Git Cow gentoo-dev 2023-05-02 20:50:25 UTC
The bug has been closed via the following commit(s):

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

commit ae11d4beef4f60804707d74f07e0c25fe6c59b5b
Author:     orbea <orbea@riseup.net>
AuthorDate: 2023-05-02 17:14:37 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-05-02 20:47:07 +0000

    dev-libs/libevent: fix the build with clang-16
    
    Closes: https://bugs.gentoo.org/880381
    Upstream-Commit: https://github.com/libevent/libevent/commit/35375101e741d78bf49642c6929c1eb69a7c3d79
    Signed-off-by: orbea <orbea@riseup.net>
    Closes: https://github.com/gentoo/gentoo/pull/30840
    Signed-off-by: Sam James <sam@gentoo.org>

 .../libevent/files/libevent-2.1.12-clang16.patch   | 105 +++++++++++++++++++++
 dev-libs/libevent/libevent-2.1.12-r1.ebuild        |   1 +
 2 files changed, 106 insertions(+)