commit:     67dd4fbd591c399f461f63d61a6012d7bf7e6237
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 16 05:20:22 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Apr 16 05:26:01 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=67dd4fbd

dev-util/bear: fix tests w/ clang 16

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/bear/bear-3.0.21.ebuild                   |  4 +++
 .../bear/files/bear-3.0.21-clang16-tests.patch     | 32 ++++++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/dev-util/bear/bear-3.0.21.ebuild b/dev-util/bear/bear-3.0.21.ebuild
index 14481878c2f2..6b0aff0cffe9 100644
--- a/dev-util/bear/bear-3.0.21.ebuild
+++ b/dev-util/bear/bear-3.0.21.ebuild
@@ -45,6 +45,10 @@ RESTRICT="!test? ( test )"
 
 S="${WORKDIR}/${P^}"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.0.21-clang16-tests.patch
+)
+
 pkg_setup() {
        use test && python-any-r1_pkg_setup
 }

diff --git a/dev-util/bear/files/bear-3.0.21-clang16-tests.patch 
b/dev-util/bear/files/bear-3.0.21-clang16-tests.patch
new file mode 100644
index 000000000000..19c63ba60849
--- /dev/null
+++ b/dev-util/bear/files/bear-3.0.21-clang16-tests.patch
@@ -0,0 +1,32 @@
+https://github.com/rizsotto/Bear/pull/521
+
+From 472cbed312444cdcef9102e924c79070ea1d3ab2 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <[email protected]>
+Date: Sat, 15 Apr 2023 19:37:41 +0200
+Subject: [PATCH] Avoid implicit function declarations in tests, for C99
+ compatibility
+
+Include <stdio.h> for printf and define _GNU_SOURCE for execvpe.
+
+Future compilers will not support implicit function declartions by
+default, causing these tests to fail to build.
+--- a/test/cases/intercept/preload/errno_reset.c
++++ b/test/cases/intercept/preload/errno_reset.c
+@@ -5,6 +5,7 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
++#include <stdio.h>
+ 
+ int main()
+ {
+--- a/test/cases/intercept/preload/posix/execvpe/success.c
++++ b/test/cases/intercept/preload/posix/execvpe/success.c
+@@ -8,6 +8,7 @@
+ #include "config.h"
+ 
+ #if defined HAVE_UNISTD_H
++#define _GNU_SOURCE
+ #include <unistd.h>
+ #endif
+ 

Reply via email to