473,545 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

signal()

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_stub s.cxx -o swf_falcon_stub s.o || ( /bin/rm -f
swf_falcon_stub s.o; exit 1 )

"Isrc/swf_falcon_stub s.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_stub s.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_stub s.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
Jul 19 '05 #1
1 4743
"Ahmed Ossman" <ah**********@m entor.com> wrote in message
news:3f******@s olnews.wv.mento rg.com...

I got the following error after a two warnig as following:

"Isrc/swf_falcon_stub s.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_stub s.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_stub s.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-lit...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
rh*******@pobox .com
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2290
by: Klaus Neuner | last post by:
Hello, consider the following two programs: # (1) import sys, signal def alarm_handler(signum, frame): raise
3
3509
by: Martin McCormick | last post by:
A C program contains several signal statements to remove a lock file if the program gets killed: /*Set up interrupt handler to catch ctrl-C so that lock file can be removed.*/ signal(SIGINT,crash); signal(SIGBUS,crash); signal(SIGSEGV,crash); This part works. Those signals cause the "crash.c" module to run and get rid of the lock. Is...
3
2665
by: LeTubs | last post by:
Hi I'm not sure if this is correct ...place to post but here goes This is what i'm trying to do, I want to write a signal / alarm handler ( I don't know which hence the posting here, as once I know the proper name /useage then I'll use google to try and find out more information ).... Thus any tips or pointers would be helpful (and I'm...
11
2937
by: Jackie | last post by:
Hi everyone, I'd like to know when and how signals are used (e.g. SIGFPE, SIGABRT, SIGTERM, SIGSEGV, SIGINT)? Thank you so much.
7
1692
by: Amit Sharma | last post by:
Hi, I want to write a program, where until we give the value of j as non zero, it should go on asking us values of i and j, displaying the message "Division by zero: Floating point exception" for every input of j as zero. Once we give the value of both i and j as non-zero, it displays i/j and terminates. This is the sample code i tried:...
2
6000
by: None | last post by:
Hello, 1. The prototype of function signal in signal.h: void (*signal(int sig, void (*func)(int)))(int); is some complex to me. Would you please explain it to me in detail with the C language syntax itself. Thank you!
7
2201
by: Stanley S | last post by:
Hi, Are Signal Handling part of ANSI C? I am not able to find any reference of Sig Handling in Stephen Prata's "C Primer Plus". The usage of signals is to trap errors I guess. (It looks similiar to the concept of try-catch to me.) It seems to relate more to nix OS. Are signals handling part of Windows too?
10
2114
by: Udai Kiran | last post by:
Hi all Iam having trouble with signal handler. Where will the execution return after invoking a signal handler when that particular signal is recieved? will return to the point where we register the signal? The following code is recieveing recursive signals. 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <unistd.h> 5
5
6631
by: david | last post by:
I'm developing a program that runs using an asyncore loop. Right now I can adequately terminate it using Control-C, but as things get refined I need a better way to stop it. I've developed another program that executes it as a child process using popen2.Popen4(). I was attempting to use signals to stop it (using os.kill()) but I keep...
9
5798
by: thagor2008 | last post by:
Is the behaviour of throwing exceptions in a unix signal handler defined? eg: void sighandler(int sig) { ... do something throw myobj; }
0
7680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7446
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7778
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6003
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5349
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3459
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
731
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.