Skip to content

Commit 51ea54e

Browse files
committed
Fixing thread start_routine signatures in tests
pthread_create function requires that start_routine has void*(void*) signature. However many tests defined this function as void*(void). When compiling such test to native code such pointer was implicitly casted. In case of Emscripten such casts are won't work and resulted in exception thrown at JavaScript side. This patch adjust tests start_routine to have proper signature.
1 parent 2637242 commit 51ea54e

File tree

70 files changed

+105
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+105
-90
lines changed

conformance/interfaces/pthread_attr_destroy/1-1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "posixtest.h"
2626

2727

28-
void *a_thread_func()
28+
void *a_thread_func(void* arg)
2929
{
3030

3131
pthread_exit(0);

conformance/interfaces/pthread_attr_init/2-1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
int sem1; /* Manual semaphore */
3535

36-
void *a_thread_func()
36+
void *a_thread_func(void* arg)
3737
{
3838

3939
/* Indicate to main() that the thread was created. */

conformance/interfaces/pthread_attr_setdetachstate/2-1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <errno.h>
2626
#include "posixtest.h"
2727

28-
void *a_thread_func()
28+
void *a_thread_func(void* arg)
2929
{
3030

3131
pthread_exit(0);

conformance/interfaces/pthread_attr_setinheritsched/2-1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "
3131

3232
const long int policy = SCHED_FIFO;
33-
void *thread_func()
33+
void *thread_func(void* arg)
3434
{
3535
int rc;
3636
int new_policy;

conformance/interfaces/pthread_attr_setschedparam/1-1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
volatile int thread_created = 0;
2929

30-
void *thread_func()
30+
void *thread_func(void* arg)
3131
{
3232
thread_created = 1;
3333
pthread_exit(0);

conformance/interfaces/pthread_attr_setschedparam/1-2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
volatile int thread_created = 0;
3030

31-
void *thread_func()
31+
void *thread_func(void* arg)
3232
{
3333
thread_created = 1;
3434
pthread_exit(0);

conformance/interfaces/pthread_attr_setschedpolicy/1-1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <errno.h>
1616
#include "posixtest.h"
1717

18-
void *thread_func()
18+
void *thread_func(void* arg)
1919
{
2020
pthread_exit(0);
2121
return (void*)(0);

conformance/interfaces/pthread_attr_setscope/1-1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#define CONSCOPE PTHREAD_SCOPE_SYSTEM
2929

30-
void *thread_func()
30+
void *thread_func(void* arg)
3131
{
3232
pthread_exit(0);
3333
return NULL;

conformance/interfaces/pthread_attr_setstack/1-1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
static void *stack_addr;
3333
size_t stack_size;
3434

35-
void *thread_func()
35+
void *thread_func(void* arg)
3636
{
3737
pthread_exit(0);
3838
return NULL;

conformance/interfaces/pthread_attr_setstack/4-1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ size_t stack_size;
3737
int teststack() {
3838
return 0;
3939
}
40-
void *thread_func()
40+
void *thread_func(void* arg)
4141
{
4242
/* execute a function to test the read/right of the stack*/
4343
if (teststack() != 0) {

0 commit comments

Comments
 (0)