I am getting anachronism errors with the solaris compiler

P

parag_paul

hi All,
Even though my function is not extern "C" ed I keep getting this
failure

ucliForceCmdObject.C", line 194: Warning (Anachronism): Formal
argument mhpiConnCb of type extern "C" int(*)(unsigned long*,unsigned
long*) in call to mhpi_connectivity_traverse(unsigned long*, unsigned
long*, extern "C" int(*)(unsigned long*,unsigned long*),
mhpiConnTrvrsModeT) is being passed int(*)(unsigned long*,unsigned
long*).
"ucliForceCmdObject.C", line 276: Warning (Anachronism): Formal
argument mhpiConnCb of type extern "C" int(*)(unsigned long*,unsigned
long*) in call to mhpi_connectivity_traverse(unsigned long*, unsigned
long*, extern "C" int(*)(unsigned long*,unsigned long*),
mhpiConnTrvrsModeT) is being passed int(*)(unsigned long*,unsigned
long*).

Can anybody help me out here
 
J

James Kanze

Even though my function is not extern "C" ed I keep getting this
failure
ucliForceCmdObject.C", line 194: Warning (Anachronism): Formal
argument mhpiConnCb of type extern "C" int(*)(unsigned long*,unsigned
long*) in call to mhpi_connectivity_traverse(unsigned long*, unsigned
long*, extern "C" int(*)(unsigned long*,unsigned long*),
mhpiConnTrvrsModeT) is being passed int(*)(unsigned long*,unsigned
long*).
"ucliForceCmdObject.C", line 276: Warning (Anachronism): Formal
argument mhpiConnCb of type extern "C" int(*)(unsigned long*,unsigned
long*) in call to mhpi_connectivity_traverse(unsigned long*, unsigned
long*, extern "C" int(*)(unsigned long*,unsigned long*),
mhpiConnTrvrsModeT) is being passed int(*)(unsigned long*,unsigned
long*).
Can anybody help me out here

Not unless you show us some code. But typically, this error is
caused by passing the address of an `extern "C++"' function as
an argument to a function expecting `extern "C"'. That is, in
fact, very precisely what the error message says: the formal
argument mhpiConnCb in function mhpi_connectivity_traverse
should have the type `extern "C" int (*)( unsigned long*,
unsigned long*)', and you've passed it an `extern "C++" int(*)(
unsigned long*, unsigned long* )'. (If you don't specify the
linkage, it is `extern "C++"'; all member functions, static or
otherwise, are also `extern "C++"'.)

So as you say: "my function is not extern "C" ed", and that is
the problem; it should be.
 
D

Default User

hi All,
Even though my function is not extern "C" ed I keep getting this
failure

ucliForceCmdObject.C", line 194: Warning (Anachronism): Formal
argument mhpiConnCb of type extern "C" int(*)(unsigned long*,unsigned
long*) in call to mhpi_connectivity_traverse(unsigned long*, unsigned
long*, extern "C" int(*)(unsigned long*,unsigned long*),
mhpiConnTrvrsModeT) is being passed int(*)(unsigned long*,unsigned
long*).
"ucliForceCmdObject.C", line 276: Warning (Anachronism): Formal
argument mhpiConnCb of type extern "C" int(*)(unsigned long*,unsigned
long*) in call to mhpi_connectivity_traverse(unsigned long*, unsigned
long*, extern "C" int(*)(unsigned long*,unsigned long*),
mhpiConnTrvrsModeT) is being passed int(*)(unsigned long*,unsigned
long*).

Can anybody help me out here


Garage mechanic: "What can I do for you?"
You: "When I turn left, my car goes ta-pocketa-pocketa-pocketa."
Garage mechanic: "All right, let's have a look at it."
You: "Oh, I didn't bring it with me."

<http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8>



Brian
 
V

Victor Bazarov

Default said:
[..]
Can anybody help me out here


Garage mechanic: "What can I do for you?"
You: "When I turn left, my car goes ta-pocketa-pocketa-pocketa."
Garage mechanic: "All right, let's have a look at it."
You: "Oh, I didn't bring it with me."

Garage mechanic: "Well, then, take two aspirins and call a doctor
in the morning".
 
P

parag_paul

Victors answer helped
Thanks a lot

And next time onwards I will bring the car too ( what if the car is a
highly sophisticated government vehicle not to be take for a ride
outside )
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

Victors answer helped
Thanks a lot

Since your still learning I'll forgive you for not quoting the text to
which you are replying, but try to do so in the future.
And next time onwards I will bring the car too ( what if the car is a
highly sophisticated government vehicle not to be take for a ride
outside )

Well, as it says in the FAQ, section 5.8, you should post a minimal but
working example, this means that if you are having troubles with your
tires you don't need to bring the whole car. For many problems you can
recreate the problem with only a few lines of code, trying to do this is
good for several reasons, one being that in the process of doing so you
might discover better understand the problem and find a solution,
another being that it's easier for those who'll try to help you if they
don't have to figure out which code is important and which is not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,619
Members
45,312
Latest member
Svsdvsdvs

Latest Threads

Top