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 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Klaus Neuner |
last post by:
Hello,
consider the following two programs:
# (1)
import sys, signal
def alarm_handler(signum, frame):
raise
|
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...
|
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...
|
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.
|
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:...
| |
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!
|
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?
|
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
|
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...
|
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;
}
|
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. ...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |