Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Insure++ Red Hat 7.1 pthread_create error: too many arguments in function

LegacyForum Posts: 1,664 ✭✭
edited December 2016 in Insure++

The “too many arguments in function call pthread_create”, PARSE_ERROR reported by Insure++ when building a threaded applications on Red Hat 7.1 using gcc 3.x

If your operating system is Linux Red Hat 7.1 and you have recently upgraded your compiler to gcc 3.x, or above you may be experiencing this PARSE_ERROR, because of a broken system header. The gcc 3.x compiler added support for __thread keyword, and your system pthread.h and sigthread.h header files, may have the __thread as a variable name in parameter list of the function definition.

Modify the variable __thread in the parameter list of the pthread.h header file. For example,

extern int pthread_create (pthread_t *__restrict __thread,
__const pthread_attr_t *__restrict __attr,
void *(*__start_routine) (void *),
void *__restrict __arg) ;

extern int pthread_create (pthread_t *__restrict __thr,
__const pthread_attr_t *__restrict __attr,
void *(*__start_routine) (void *),
void *__restrict __arg) ;


Add ‘—mpf –no_thread_local_storage to your command line. For example

Insure gcc –g –mpf –no_thread_local_storage –o threads threads.c –lpthread