Skip to content

Commit 711a5c4

Browse files
committed
Resolve broken typecast
Addressing: In file included from /home/jcerny/openscap/src/OVAL/probes/probe/input_handler.c:28: /home/jcerny/openscap/src/OVAL/probes/probe/input_handler.c: In function ‘probe_input_handler’: /home/jcerny/openscap/src/OVAL/probes/probe/input_handler.c:77:30: warning: cast between incompatible function types from ‘int (*)(pthread_attr_t *)’ {aka ‘int (*)(union pthread_attr_t *)’} to ‘void (*)(void *)’ [-Wcast-function-type] pthread_cleanup_push((void(*)(void *))pthread_attr_destroy, (void *)&pth_attr); ^
1 parent d5deb54 commit 711a5c4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/OVAL/probes/probe/input_handler.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
#include "input_handler.h"
3939
#include "common/compat_pthread_barrier.h"
4040

41+
static void cleanup_handler(void *arg)
42+
{
43+
pthread_attr_destroy(arg);
44+
}
45+
4146
/*
4247
* The input handler waits for incomming eval requests and either returns
4348
* a result immediately if it is found in the result cache or spawns a new
@@ -74,7 +79,7 @@ void *probe_input_handler(void *arg)
7479
return (NULL);
7580
}
7681

77-
pthread_cleanup_push((void(*)(void *))pthread_attr_destroy, (void *)&pth_attr);
82+
pthread_cleanup_push(cleanup_handler, (void *)&pth_attr);
7883

7984
switch (errno = pthread_barrier_wait(&OSCAP_GSYM(th_barrier)))
8085
{

0 commit comments

Comments
 (0)