summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Haarman <inglorion@google.com>2022-09-14 13:46:12 -0700
committerSam James <sam@gentoo.org>2022-09-15 01:09:40 +0100
commit7699c657393b3495f0105e202b0a166a47743e5f (patch)
treebb465213f7b9b8536c795cabf23c55fd0a434653
parentnet-libs/rpcsvc-proto: search for a valid 'cpp' command (diff)
downloadgentoo-7699c657393b3495f0105e202b0a166a47743e5f.tar.gz
gentoo-7699c657393b3495f0105e202b0a166a47743e5f.tar.bz2
gentoo-7699c657393b3495f0105e202b0a166a47743e5f.zip
sys-apps/sed: patch to avoid diagnostic during build
sed-4.8 uses an old version of gnulib, which assigns a function declared with _Noreturn to a variable declared with __attribute__((__noreturn__)). This causes the types to mismatch, which produces a Clang diagnostic. This change fixes the issue by using __attribute__((__noreturn__)) for both the function definition and the variable. The same fix was applied to upstream gnulib, which has since been pulled into the development version of sed. Once we update sed to a version that includes the fix, we will not need this local patch anymore. Signed-off-by: Robbert Haarman <inglorion@google.com> Closes: https://github.com/gentoo/gentoo/pull/27257 Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--sys-apps/sed/files/sed-4.8-avoid-noreturn-diagnostic.patch21
-rw-r--r--sys-apps/sed/sed-4.8.ebuild4
2 files changed, 25 insertions, 0 deletions
diff --git a/sys-apps/sed/files/sed-4.8-avoid-noreturn-diagnostic.patch b/sys-apps/sed/files/sed-4.8-avoid-noreturn-diagnostic.patch
new file mode 100644
index 000000000000..d361780b548d
--- /dev/null
+++ b/sys-apps/sed/files/sed-4.8-avoid-noreturn-diagnostic.patch
@@ -0,0 +1,21 @@
+https://github.com/coreutils/gnulib/commit/0cc39712803ade7b2d4b89c36b143dad72404063
+
+From 0cc39712803ade7b2d4b89c36b143dad72404063 Sun Oct 18 00:00:00 2020
+From: Bruno Haible <bruno@clisp.org>
+
+obstack: Fix a clang warning.
+* lib/obstack.c (print_and_abort): Mark as __attribute_noreturn__.
+
+diff --git a/lib/obstack.c b/lib/obstack.c
+index 6e82da054c..e6475a2a09 100644
+--- a/lib/obstack.c
++++ b/lib/obstack.c
+@@ -326,7 +326,7 @@ int obstack_exit_failure = EXIT_FAILURE;
+ # include <libio/iolibio.h>
+ # endif
+
+-static _Noreturn void
++static __attribute_noreturn__ void
+ print_and_abort (void)
+ {
+ /* Don't change any of these strings. Yes, it would be possible to add
diff --git a/sys-apps/sed/sed-4.8.ebuild b/sys-apps/sed/sed-4.8.ebuild
index d71ab4f61ead..060be8689435 100644
--- a/sys-apps/sed/sed-4.8.ebuild
+++ b/sys-apps/sed/sed-4.8.ebuild
@@ -33,6 +33,10 @@ DEPEND="${RDEPEND}
BDEPEND="nls? ( sys-devel/gettext )
verify-sig? ( sec-keys/openpgp-keys-sed )"
+PATCHES=(
+ "${FILESDIR}/${P}-avoid-noreturn-diagnostic.patch"
+)
+
src_configure() {
use static && append-ldflags -static