Re: ?? warning: ANSI C++ forbids implicit conversion from `void *' in argument passing
- From: Sven Neumann <sven gimp org>
- 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: 15 Feb 2002 22:45:24 +0100
Hi,
Chris Seberino <seberino spawar navy mil> writes:
> pthread_t thread;
>
> pthread_create(&thread, NULL, (void*) &doSimulation, NULL);
>
> Help! I trying to assign a function to a thread in my amateur
> PThread calls above. Without (void*) before function name I get
> an error and WITH (void*) I get following warning:
>
> warning: ANSI C++ forbids implicit conversion from `void *' in argument passing
>
> This would all be harmless except I believe newer GTK+
> or something in my Linux distro upgrade causes BOTH
> (with and without (void*)) to return an error!!!
>
> NEITHER WORKS!!
>
> Is there someway to fix this to avoid errors and warnings??
yes, make doSimulation a void * function that takes a void * parameter:
static void * doSimulation (void *data);
or the equivalent glib-style
static gpointer doSimulation (gpointer data);
Salut, Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]