i am getting this error :

"../incl/GDS_Thread/Thread.h", line 141: Warning (Anachronism): Formal argument 3 of type extern "C" void*(*)(void*) in call to pthread_create(unsigned*, const _pthread_attr*, extern "C" void*(*)(void*), void*) is being passed void*(*)(void*).
"../incl/GDS_Thread/Thread.h", line 221: Warning (Anachronism): Formal argument 2 of type extern "C" void(*)() in call to pthread_once(_once*, extern "C" void(*)()) is being passed void(*)().
"/sbcimp/run/tp/sun/SUNWspro/v8/prod/include/CC/Cstd/rw/rwdispatch.h", line 63: Error: _RW_is_integral_type(int) already had a body defined.
"/sbcimp/run/tp/sun/SUNWspro/v8/prod/include/CC/Cstd/rw/rwdispatch.h", line 121: Error: Multiple declaration for _RWdispatch<int>.
"Sql.cc", line 653: Warning: String literal converted to char* in formal argument buf in call to ct_command(_cscommand*, long, char*, long, long).
2 Error(s) and 3 Warning(s) detected

Any idea how can i resolve it.

Recommended Answers

All 3 Replies

Which version are you using? looks like it is not compatible with your compiler version.

Which version are you using? looks like it is not compatible with your compiler version.

i am using Compiler "/sbcimp/run/tp/sun/SUNWspro/v8/bin" i.e version 5.5 Sun C++ compiler.

and you can see it is refreing to "/sbcimp/run/tp/sun/SUNWspro/v8/prod/include/CC/Cstd/rw/rwdispatch.h"

And yes i am trying to port some of the files which are previously build on v4.2.p3 sun compiler to 5.5 version.

Any suggestions plz.

On the face of it, it would seem that you're passing a pointer to a function (which is a C++ function), to a C function (pthread_create) which expects a pointer to a C function.
Put extern "C" in front of the prototype/declaration of the function you want to run as a thread.

> Warning: String literal converted to char*
String literals are const char * . The function you're passing this to only expects a char * variable, and would be allowed to modify the string.
If this can never happen, then make the function take a const char * parameter.
If the function can modify it, then you need to make a writeable copy of your string.

As for the rwdispatch.h problems, I've no idea. It seems a code problem in the RW library itself.
Did you include the same file twice perhaps?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.