Re: ?? warning: ANSI C++ forbids implicit conversion from `void *' in argument passing
- From: Paul Davis <pbd Op Net>
- To: Chris Seberino <seberino spawar navy mil>
- Cc: gtk-list gnome org
- Subject: Re: ?? warning: ANSI C++ forbids implicit conversion from `void *' in argument passing
- Date: Fri, 15 Feb 2002 16:25:58 -0500
>
> pthread_t thread;
>
> pthread_create(&thread, NULL, (void*) &doSimulation, NULL);
the correct declaration for a thread function is:
void *the_function_name (void *);
if your function is not declared like that, you will need to cast it:
pthread_create (&thread, NULL, (void *()(void*)) the_function, NULL);
but its generally a bad idea to be calling functions which have the
wrong prototype.
in ANSI C and C++, you do NOT need to dereference the name of a
function object to use it as a pointer:
pthread_create(&thread, NULL, doSimulation, NULL);
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]