commit:     3e56cd93c27c158d848d6f495b3563816f49e888
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  5 23:58:31 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov  6 01:49:32 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e56cd93

net-dns/avahi: fix configure w/ -Werror=strict-prototypes

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

 .../{avahi-0.8-r6.ebuild => avahi-0.8-r7.ebuild}   |  1 +
 .../avahi/files/avahi-0.8-strict-prototypes.patch  | 38 ++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/net-dns/avahi/avahi-0.8-r6.ebuild 
b/net-dns/avahi/avahi-0.8-r7.ebuild
similarity index 99%
rename from net-dns/avahi/avahi-0.8-r6.ebuild
rename to net-dns/avahi/avahi-0.8-r7.ebuild
index 73f14ba3bf3c..ed36d9edfc0c 100644
--- a/net-dns/avahi/avahi-0.8-r6.ebuild
+++ b/net-dns/avahi/avahi-0.8-r7.ebuild
@@ -74,6 +74,7 @@ PATCHES=(
        "${FILESDIR}/${P}-dependency-error.patch"
        "${FILESDIR}/${P}-null-pointer-crash.patch"
        "${FILESDIR}/${P}-potentially-undefined-fix.patch"
+       "${FILESDIR}/${P}-strict-prototypes.patch"
 # These patches do not apply cleanly but may need to be re-instated.
 # I'll leave them commented out for now.
 #      "${FILESDIR}/${PN}-0.7-qt5.patch"

diff --git a/net-dns/avahi/files/avahi-0.8-strict-prototypes.patch 
b/net-dns/avahi/files/avahi-0.8-strict-prototypes.patch
new file mode 100644
index 000000000000..3954aa4357ae
--- /dev/null
+++ b/net-dns/avahi/files/avahi-0.8-strict-prototypes.patch
@@ -0,0 +1,38 @@
+https://github.com/lathiat/avahi/pull/405
+
+From 54409e5af9c382117b67674756971f4f1bf646f8 Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Sat, 5 Nov 2022 23:49:47 +0000
+Subject: [PATCH] configure.ac: fix -Wstrict-prototypes
+
+Fixes errors like:
+```
+-ignoreme: warning: a function definition without a prototype is deprecated in 
all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
++ignoreme: error: a function definition without a prototype is deprecated in 
all versions of C and is not supported in C2x 
[-Werror,-Wdeprecated-non-prototype]
+ void test_broken_ssp(c)
+      ^
+```
+
+Signed-off-by: Sam James <[email protected]>
+--- a/configure.ac
++++ b/configure.ac
+@@ -99,8 +99,7 @@ if test x"$enable_ssp" = x"yes"; then
+     LDFLAGS="$LDFLAGS -Wl,-z,defs"
+     cat confdefs.h > conftest.c
+     cat >>conftest.c <<_ACEOF
+-void test_broken_ssp(c)
+-    const char *c;
++void test_broken_ssp(const char *c)
+ {
+     char arr[[123]], *p; /* beware of possible double-braces if copying this 
*/
+     for (p = arr; *c; ++p) {
+@@ -300,7 +299,7 @@ AM_CONDITIONAL(TARGET_FREEBSD, test x"$with_distro" = 
xfreebsd)
+ AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
+ 
+ test_gcc_flag() {
+-    AC_LANG_CONFTEST([int main() {}])
++    AC_LANG_CONFTEST([int main(void) {}])
+     $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
+     ret=$?
+     rm -f conftest.o
+

Reply via email to