Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH 1/2] autoconf: follow the advice to assume RETSIGTYPE is void



This has not been an issue on any platform for over a decade.

Signed-off-by: Eitan Adler <lists@xxxxxxxxxxxxxx>
---
 Src/Modules/zftp.c |  2 +-
 Src/signals.c      |  2 +-
 Src/signals.h      |  2 +-
 configure.ac       | 12 ------------
 4 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c
index 24f4b4200..4aaa1f072 100644
--- a/Src/Modules/zftp.c
+++ b/Src/Modules/zftp.c
@@ -362,7 +362,7 @@ static jmp_buf zfalrmbuf;
 /* The signal handler itself */
 
 /**/
-static RETSIGTYPE
+static void
 zfhandler(int sig)
 {
     if (sig == SIGALRM) {
diff --git a/Src/signals.c b/Src/signals.c
index 4958534e2..20c6fdf4a 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -588,7 +588,7 @@ wait_for_processes(void)
 /* the signal handler */
  
 /**/
-mod_export RETSIGTYPE
+mod_export void
 zhandler(int sig)
 {
     sigset_t newmask, oldmask;
diff --git a/Src/signals.h b/Src/signals.h
index 1904f4326..41ac88cce 100644
--- a/Src/signals.h
+++ b/Src/signals.h
@@ -27,7 +27,7 @@
  *
  */
 
-#define SIGNAL_HANDTYPE RETSIGTYPE (*)_((int))
+#define SIGNAL_HANDTYPE void (*)_((int))
 
 #ifndef HAVE_KILLPG
 # define killpg(pgrp,sig) kill(-(pgrp),sig)
diff --git a/configure.ac b/configure.ac
index b46e2f4c2..7644ebe52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -955,18 +955,6 @@ dnl --------------
 dnl CHECK TYPEDEFS
 dnl --------------
 
-AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
-Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl
-AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
-[AC_LANG_PROGRAM([#include <sys/types.h>
-#include <signal.h>
-],
-		 [return *(signal (0, 0)) (0) == 1;])],
-		   [ac_cv_type_signal=int],
-		   [ac_cv_type_signal=void])])
-AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
-		    (`int' or `void').])
-
 AC_TYPE_PID_T
 AC_TYPE_OFF_T
 AC_CHECK_TYPE(ino_t, unsigned long)
-- 
2.17.1



Messages sorted by: Reverse Date, Date, Thread, Author