Skip to content

Commit

Permalink
configure: remove use of RETSIGTYPE
Browse files Browse the repository at this point in the history
This was previously defined by the obsolete AC_TYPE_SIGNAL macro,
which was removed in 2682e5f. The deprecation text says

> Your code may safely assume C89 semantics that RETSIGTYPE is void.

So, remove it and just use void instead.

Closes curl#6861
  • Loading branch information
michaelforney authored and bagder committed Apr 7, 2021
1 parent 694eab1 commit 812fce9
Show file tree
Hide file tree
Showing 19 changed files with 12 additions and 85 deletions.
20 changes: 1 addition & 19 deletions CMake/CurlTests.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2020, Daniel Stenberg, <[email protected]>, et al.
* Copyright (C) 1998 - 2021, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -214,24 +214,6 @@ if (sizeof (bool *) )
#include <float.h>
int main() { return 0; }
#endif
#ifdef RETSIGTYPE_TEST
#include <sys/types.h>
#include <signal.h>
#ifdef signal
# undef signal
#endif
#ifdef __cplusplus
extern "C" void (*signal (int, void (*)(int)))(int);
#else
void (*signal ()) ();
#endif

int
main ()
{
return 0;
}
#endif
#ifdef HAVE_INET_NTOA_R_DECL
#include <arpa/inet.h>

Expand Down
1 change: 0 additions & 1 deletion CMake/Platforms/WindowsCache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ if(NOT UNIX)
set(HAVE_GETADDRINFO 0)
endif()
set(STDC_HEADERS 1)
set(RETSIGTYPE_TEST 1)

set(HAVE_SIGACTION 0)
set(HAVE_MACRO_SIGSETJMP 0)
Expand Down
7 changes: 0 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,6 @@ foreach(CURL_TEST
HAVE_IN_ADDR_T
HAVE_BOOL_T
STDC_HEADERS
RETSIGTYPE_TEST
HAVE_INET_NTOA_R_DECL
HAVE_INET_NTOA_R_DECL_REENTRANT
HAVE_GETADDRINFO
Expand Down Expand Up @@ -1209,12 +1208,6 @@ if(HAVE_FIONBIO OR
set(HAVE_DISABLED_NONBLOCKING)
endif()

if(RETSIGTYPE_TEST)
set(RETSIGTYPE void)
else()
set(RETSIGTYPE int)
endif()

if(CMAKE_COMPILER_IS_GNUCC AND APPLE)
include(CheckCCompilerFlag)
check_c_compiler_flag(-Wno-long-double HAVE_C_FLAG_Wno_long_double)
Expand Down
5 changes: 2 additions & 3 deletions lib/Makefile.netware
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 2004 - 2015, Guenter Knauf
# Copyright (C) 2001 - 2020, Daniel Stenberg, <[email protected]>, et al.
# Copyright (C) 2004 - 2015, 2021, Guenter Knauf
# Copyright (C) 2001 - 2021, Daniel Stenberg, <[email protected]>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -599,7 +599,6 @@ endif
@echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
@echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
@echo $(DL)#define HAVE_WRITEV 1$(DL) >> $@
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
@echo $(DL)#define SIZEOF_INT 4$(DL) >> $@
@echo $(DL)#define SIZEOF_SHORT 2$(DL) >> $@
@echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
Expand Down
3 changes: 1 addition & 2 deletions lib/config-amigaos.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2020, Daniel Stenberg, <[email protected]>, et al.
* Copyright (C) 1998 - 2021, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -103,7 +103,6 @@
#define PACKAGE_VERSION "-"
#define CURL_CA_BUNDLE "s:curl-ca-bundle.crt"

#define RETSIGTYPE void
#define SELECT_TYPE_ARG1 int
#define SELECT_TYPE_ARG234 (fd_set *)
#define SELECT_TYPE_ARG5 (struct timeval *)
Expand Down
3 changes: 1 addition & 2 deletions lib/config-dos.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2020, Daniel Stenberg, <[email protected]>, et al.
* Copyright (C) 1998 - 2021, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -84,7 +84,6 @@

#define NEED_MALLOC_H 1

#define RETSIGTYPE void
#define SIZEOF_INT 4
#define SIZEOF_LONG 4
#define SIZEOF_LONG_DOUBLE 16
Expand Down
4 changes: 1 addition & 3 deletions lib/config-mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2020, Daniel Stenberg, <[email protected]>, et al.
* Copyright (C) 1998 - 2021, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -81,8 +81,6 @@
#define HAVE_IOCTL 1
#define HAVE_IOCTL_FIONBIO 1

#define RETSIGTYPE void

#define SIZEOF_INT 4
#define SIZEOF_SHORT 2
#define SIZEOF_SIZE_T 4
Expand Down
3 changes: 0 additions & 3 deletions lib/config-os400.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,6 @@
/* Name of package */
#undef PACKAGE

/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void

/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4

Expand Down
2 changes: 0 additions & 2 deletions lib/config-plan9.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
#define RANDOM_FILE "/dev/random"
#define VERSION "0.0.0" /* TODO */

#define RETSIGTYPE void

#define STDC_HEADERS 1

#ifdef _BITS64
Expand Down
3 changes: 0 additions & 3 deletions lib/config-riscos.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,6 @@
/* Name of package */
#undef PACKAGE

/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void

/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4

Expand Down
3 changes: 0 additions & 3 deletions lib/config-tpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,6 @@
/* a suitable file to read random data from */
/* #undef RANDOM_FILE */

/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void

/* Define to the type of arg 1 for `select'. */
#define SELECT_TYPE_ARG1 int

Expand Down
3 changes: 0 additions & 3 deletions lib/config-vxworks.h
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,6 @@
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int

/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void

/* Define to the type qualifier of arg 5 for select. */
#define SELECT_QUAL_ARG5

Expand Down
3 changes: 0 additions & 3 deletions lib/config-win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,6 @@
/* Define if in_addr_t is not an available 'typedefed' type. */
#define in_addr_t unsigned long

/* Define to the return type of signal handlers (int or void). */
#define RETSIGTYPE void

/* Define if ssize_t is not an available 'typedefed' type. */
#ifndef _SSIZE_T_DEFINED
# if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
Expand Down
3 changes: 0 additions & 3 deletions lib/config-win32ce.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,6 @@
/* Define this if in_addr_t is not an available 'typedefed' type */
#define in_addr_t unsigned long

/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void

/* Define ssize_t if it is not an available 'typedefed' type */
#if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || defined(__POCC__)
#elif defined(_WIN64)
Expand Down
3 changes: 0 additions & 3 deletions lib/curl_config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -876,9 +876,6 @@
/* Define to the function return type for recv. */
#cmakedefine RECV_TYPE_RETV ${RECV_TYPE_RETV}

/* Define as the return type of signal handlers (`int' or `void'). */
#cmakedefine RETSIGTYPE ${RETSIGTYPE}

/* Define to the type qualifier of arg 5 for select. */
#cmakedefine SELECT_QUAL_ARG5 ${SELECT_QUAL_ARG5}

Expand Down
11 changes: 1 addition & 10 deletions lib/curl_setup_once.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2020, Daniel Stenberg, <[email protected]>, et al.
* Copyright (C) 1998 - 2021, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -350,15 +350,6 @@ typedef int sig_atomic_t;
#endif


/*
* Default return type for signal handlers.
*/

#ifndef RETSIGTYPE
#define RETSIGTYPE void
#endif


/*
* Macro used to include code only in debug builds.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/hostip.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data,
* within a signal handler which is nonportable and could lead to problems.
*/
static
RETSIGTYPE alarmfunc(int sig)
void alarmfunc(int sig)
{
/* this is for "-ansi -Wall -pedantic" to stop complaining! (rabe) */
(void)sig;
Expand Down
12 changes: 1 addition & 11 deletions packages/vms/config_h.com
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $!
$! This procedure may not guess the options correctly for all architectures,
$! and is a work in progress.
$!
$! Copyright 2011 - 2020, John Malmberg
$! Copyright 2011 - 2021, John Malmberg
$!
$! Permission to use, copy, modify, and/or distribute this software for any
$! purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -1855,16 +1855,6 @@ $ write tf "#endif"
$ goto cfgh_in_loop1
$ endif
$!
$! Process RETSIGTYPE directive
$!----------------------------------
$ if key2 .eqs. "RETSIGTYPE"
$ then
$ write tf "#ifndef RETSIGTYPE"
$ write tf "#define RETSIGTYPE void"
$ write tf "#endif"
$ goto cfgh_in_loop1
$ endif
$!
$! Process STDC_HEADERS (SAMBA!)
$!---------------------------
$ if key2 .eqs. "STDC_HEADERS"
Expand Down
6 changes: 3 additions & 3 deletions tests/server/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2020, Daniel Stenberg, <[email protected]>, et al.
* Copyright (C) 1998 - 2021, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -543,7 +543,7 @@ long timediff(struct timeval newer, struct timeval older)

/* vars used to keep around previous signal handlers */

typedef RETSIGTYPE (*SIGHANDLER_T)(int);
typedef void (*SIGHANDLER_T)(int);

#ifdef SIGHUP
static SIGHANDLER_T old_sighup_handler = SIG_ERR;
Expand Down Expand Up @@ -591,7 +591,7 @@ HANDLE exit_event = NULL;
* The first time this is called it will set got_exit_signal to one and
* store in exit_signal the signal that triggered its execution.
*/
static RETSIGTYPE exit_signal_handler(int signum)
static void exit_signal_handler(int signum)
{
int old_errno = errno;
logmsg("exit_signal_handler: %d", signum);
Expand Down

0 comments on commit 812fce9

Please sign in to comment.