Skip to content

Commit 2068d23

Browse files
committed
Fix [-Wstrict-prototypes] warning in PCNTL extension
To achieve this we need to introduce a new wrapper function with dummy arguments which calls pcntl_signal_dispatch() to respect the function pointer signature for a tick function.
1 parent b735669 commit 2068d23

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ext/pcntl/pcntl.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ static void pcntl_siginfo_to_zval(int, siginfo_t*, zval*);
8989
#else
9090
static void pcntl_signal_handler(int);
9191
#endif
92-
static void pcntl_signal_dispatch();
92+
static void pcntl_signal_dispatch(void);
93+
static void pcntl_signal_dispatch_tick_function(int dummy_int, void *dummy_pointer);
9394
static void pcntl_interrupt_function(zend_execute_data *execute_data);
9495

9596
void php_register_signal_constants(INIT_FUNC_ARGS)
@@ -424,7 +425,7 @@ static PHP_GINIT_FUNCTION(pcntl)
424425

425426
PHP_RINIT_FUNCTION(pcntl)
426427
{
427-
php_add_tick_function(pcntl_signal_dispatch, NULL);
428+
php_add_tick_function(pcntl_signal_dispatch_tick_function, NULL);
428429
zend_hash_init(&PCNTL_G(php_signal_table), 16, NULL, ZVAL_PTR_DTOR, 0);
429430
PCNTL_G(head) = PCNTL_G(tail) = PCNTL_G(spares) = NULL;
430431
PCNTL_G(async_signals) = 0;
@@ -1385,6 +1386,11 @@ void pcntl_signal_dispatch()
13851386
sigprocmask(SIG_SETMASK, &old_mask, NULL);
13861387
}
13871388

1389+
static void pcntl_signal_dispatch_tick_function(int dummy_int, void *dummy_pointer)
1390+
{
1391+
return pcntl_signal_dispatch();
1392+
}
1393+
13881394
/* {{{ Enable/disable asynchronous signal handling and return the old setting. */
13891395
PHP_FUNCTION(pcntl_async_signals)
13901396
{

0 commit comments

Comments
 (0)