Share your knowledge at the LQ Wiki.
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, 07: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, 08:44 AM   #2
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,294

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335

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 02:46 AM
warning: passing argument 2 of ‘strcpy’ makes pointer from integer without a cast nasim751 Programming 2 02-10-2008 11:47 PM
warning: passing argument 2 of ‘memset’ makes integer from pointer without a cast nasim751 Programming 3 01-30-2008 10:16 AM
What is the warning: passing arg 3 of `pthread_create' from incompatible pointer type wallwaters Linux - Software 3 06-01-2005 09:30 AM
passing function pointer as argument worldmagic Programming 7 08-04-2004 04:33 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:11 AM.

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