[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] [c] pthreads og endnu en warning jeg ikke lige kan komme af med.



On Wed, Nov 26, 2003 at 01:20:22PM +0100, Kim Schulz wrote:
<snip>
> main.c:75: warning: passing arg 3 of `pthread_create' from incompatible
> pointer type 
> main.c:78: warning: passing arg 3 of `pthread_create' from incompatible
> pointer type
> 
> linje 75:
> pthread_create(&WorkerListener, NULL, ListenForWorker, &lagerarbejder);
> 
> linje 78:
> pthread_create(&OrderListener, NULL, ListenForOrder, &Ordre);
> 
> ListenFor[Worker|Order]  er defineret som:
> void ListenForWorker(struct hostent *worker);
> void ListenForOrder(Orderliste *Ordre);
Hvis jeg ikke husker helt talt, så tager pthread_create en funktion af
formen:

void *func(void *)

som parameter. Så det er nok fordi din ListenForWorker og ListenForOrder
returnerer void, at du får warnings. Nu er jeg mest vandt til C++, og
der ville det også være nødvendigt at lave "struct hostent *" om til
"void *", for at den ville kompilere det... Jeg ved ikke om det også er
nødvendigt for at fjerne warningen i C.

-- 
/-----------------------------------------------------\
| Klaus S. Madsen      | "Failure is not an option... |
| ICQ: 45400164        |  It comes bundled with your  |
| www.hjernemadsen.org |  Microsoft products!"        |
\-----------------------------------------------------/


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:10 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *