signal()

A

Ahmed Ossman

Hi Group,
I have a serious question here, I got the following error after a two warnig
as following:
/opt/SUNWspro/bin/CC -Dsun -Dsparc -D_SYSTYPE_SYSV -DSYSTYPE_SYSV -DMK_VENDO
R_CC -xO4 -DNDEBUG -DNDEBUG -I/project/qsim/iwa/simview_ss8/mgc_home.ss5/sha
red/include -I. -IIsrc -I../glue -G -Dvco_ss5 -I/usr/opt/purify -I/usr/opt/p
urecov -I/usr/opt/quantify -DNON_PORTABLE -DNDBGMGR -DNDBGMGR -c
Isrc/swf_falcon_stubs.cxx -o swf_falcon_stubs.o || ( /bin/rm -f
swf_falcon_stubs.o; exit 1 )

"Isrc/swf_falcon_stubs.cxx", line 67: Warning (Anachronism): Formal argument
2 of type extern "C" void(*)(int) in call to std::signal(int, extern "C"
void(*)(int)) is being passed void(*)(int).

"Isrc/swf_falcon_stubs.cxx", line 129: Warning (Anachronism): Formal
argument 2 of type extern "C" void(*)(int) in call to std::signal(int,
extern "C" void(*)(int)) is being passed void(*)(int).

"Isrc/swf_falcon_stubs.cxx", line 140: Error: Could not find a match for
std::signal(int, void(*)(int)).

I think the problem can be solved by type casting,

Please advice..

Thanks,
Ahmed Ossman
 
R

Russell Hanneken

Ahmed Ossman said:
I got the following error after a two warnig as following:

"Isrc/swf_falcon_stubs.cxx", line 67: Warning (Anachronism): Formal
argument 2 of type extern "C" void(*)(int) in call to std::signal(int,
extern "C" void(*)(int)) is being passed void(*)(int).

"Isrc/swf_falcon_stubs.cxx", line 129: Warning (Anachronism): Formal
argument 2 of type extern "C" void(*)(int) in call to std::signal(int,
extern "C" void(*)(int)) is being passed void(*)(int).

"Isrc/swf_falcon_stubs.cxx", line 140: Error: Could not find a match for
std::signal(int, void(*)(int)).

It sounds like std::signal expects the second parameter to be a pointer to a
function with C linkage, and you're passing a pointer to a function with C++
linkage. Try putting the signal handlers in a separate module (if they
aren't already) and putting the declarations for your signal handlers inside
an extern "C" block:

extern "C"
{
void handler1 (int sig);
void handler2 (int sig);
}

You might want to read this section of the C++ FAQ:

http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html

If that doesn't work, please post a code example. Try to make it the
smallest complete program that exhibits your problem.

Regards,

Russell Hanneken
(e-mail address removed)
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top