Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-19-2009, 06:50 AM   #1
LQ Newbie
Registered: Jan 2009
Posts: 1

Rep: Reputation: 0
warning: passing argument 3 of ‘pthread_create’ from incompatible pointer type

Hello there,

I cant understand why this warning: "passing argument 3 of ‘pthread_create’ from incompatible pointer type" occurs, can i get some help plz.Here is my code

#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

int globalVariable;

void *stringManager( char *param );

int main( int argc, char *argv[] )

		fprintf(stderr,"usage:a.out<integer value>\n");

		return -1;


	pthread_t tid;
        pthread_attr_t attr;



	printf("Global variable is : %d\n", globalVariable);

	return 0;
void *stringManager( char *param )
	int i;

	for( i=0; i<30; i++ )
		globalVariable = globalVariable + 1;
Old 01-19-2009, 07:44 AM   #2
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,195

Rep: Reputation: 265Reputation: 265Reputation: 265

Change it to:

void *stringManager( void *param );

This will get rid of the warning. You can then typecast param to char pointer inside the function.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
passing arg 3 of `pthread_create' from incompatible pointer type wallwaters Programming 8 03-08-2010 01:46 AM
warning: passing argument 2 of ‘strcpy’ makes pointer from integer without a cast nasim751 Programming 2 02-10-2008 10:47 PM
warning: passing argument 2 of ‘memset’ makes integer from pointer without a cast nasim751 Programming 3 01-30-2008 09:16 AM
What is the warning: passing arg 3 of `pthread_create' from incompatible pointer type wallwaters Linux - Software 3 06-01-2005 08:30 AM
passing function pointer as argument worldmagic Programming 7 08-04-2004 03:33 PM

All times are GMT -5. The time now is 05:10 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration