commit:     ec04583bc2ab4515cffc7f3677fb35eddb615610
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 19 08:08:46 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Apr 19 08:09:47 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec04583b

app-editors/joe: Port to C99

Closes: https://bugs.gentoo.org/900164
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 app-editors/joe/files/joe-4.6-c99.patch | 59 +++++++++++++++++++++++++++++++++
 app-editors/joe/joe-4.6-r2.ebuild       |  3 +-
 2 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/app-editors/joe/files/joe-4.6-c99.patch 
b/app-editors/joe/files/joe-4.6-c99.patch
new file mode 100644
index 000000000000..8d7a64a6419f
--- /dev/null
+++ b/app-editors/joe/files/joe-4.6-c99.patch
@@ -0,0 +1,59 @@
+https://bugs.gentoo.org/900164
+Patch from https://sourceforge.net/p/joe-editor/mercurial/merge-requests/3/
+
+commit 26e83257075789d901cadbe280ff7f1bd7602983
+Authored by: Nikita Popov 2023-01-31
+
+   Port to C99
+
+   Ensure that functions are declared before use for compatibility
+   with newer compiler versions.
+
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -9,7 +9,7 @@
+ int main() {
+   int a = 0;
+   isblank(a++);
+-  exit(a != 1);
++  return a != 1;
+ }
+                       ],
+                       [joe_cv_isblank=yes],
+@@ -34,7 +34,7 @@
+ #endif
+ int main() {
+       /* exit succesfully if setpgrp() takes two args (*BSD systems) */
+-      exit(setpgrp(0, 0) != 0);
++      return setpgrp(0, 0) != 0;
+ }],
+                       [joe_cv_setpgrp_void=no],
+                       [joe_cv_setpgrp_void=yes],
+@@ -95,7 +95,7 @@
+       kill((int)getpid(), SIGINT);
+       kill((int)getpid(), SIGINT);
+       /* exit succesfully if don't have to reinstall sighandler when invoked 
*/
+-      exit(nsigint != 2);
++      return nsigint != 2;
+ }],
+                       [joe_cv_reinstall_sighandlers=no],
+                       [joe_cv_reinstall_sighandlers=yes],
+--- a/joe/selinux.c
++++ b/joe/selinux.c
+@@ -6,6 +6,7 @@
+ 
+ #ifdef WITH_SELINUX
+ #include <selinux/selinux.h>
++#include <error.h>
+ static int selinux_enabled = -1;
+ #endif
+ 
+@@ -108,7 +109,7 @@
+               return 0;
+ 
+       if (setfscreatecon(0) < 0) {
+-              error(0, errno, joe_gettext(_("Could not reset default security 
context")));
++              error(0, errno, "%s", joe_gettext(_("Could not reset default 
security context")));
+               return 1;
+       }
+ #endif

diff --git a/app-editors/joe/joe-4.6-r2.ebuild 
b/app-editors/joe/joe-4.6-r2.ebuild
index 1f5bdf049228..ef18848b930d 100644
--- a/app-editors/joe/joe-4.6-r2.ebuild
+++ b/app-editors/joe/joe-4.6-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -22,6 +22,7 @@ PATCHES=(
        "${FILESDIR}/${PN}-4.3-tinfo.patch"
        "${FILESDIR}/${P}-db.patch"
        "${FILESDIR}/${P}-prototypes.patch"
+       "${FILESDIR}/${P}-c99.patch"
 )
 
 DOCS=( README.md NEWS.md docs/hacking.md docs/man.md )

Reply via email to