我需要使用pthread,但是不需要向函数传递任何参数。因此,我在pthread_create函数中将参数设置为NULL。我有7个pthread,所以gcc编译器会警告我有7个未使用的参数。在C编程中如何定义这7个参数为未使用?如果不将这些参数定义为未使用,是否会导致问题?非常感谢您的回应。
void *timer1_function(void * parameter1){
//<statement>
}
int main(int argc,char *argv[]){
int thread_check1;
pthread_t timer1;
thread_check1 = pthread_create( &timer1, NULL, timer1_function, NULL);
if(thread_check1 !=0){
perror("thread creation failed");
exit(EXIT_FAILURE);
}
while(1){}
return 0;
}