- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: warning 604: Pointers are not assignment-comp...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2007 01:31 AM
03-13-2007 01:31 AM
In both cases, the compiler issues this message. Using the signal code, it flags the signal(SIGINT,proc) line, using the sigactions, it flags the new_action.sa_handler = proc; line. The program works just fine (catches the signal), but I would like to get rid of the warning message and understand why I am getting it.
Can anyone help?
Thx,
jls
Solved! Go to Solution.
- Tags:
- signal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2007 02:21 AM
03-13-2007 02:21 AM
Solution--------------------------------------------
#include
#include
#include
#include
void Handler(int sig)
{
(void) signal(sig,Handler); /* reset Handler */
(void) printf("Received signal %d\n",sig);
return;
} /* Handler */
int main()
{
int i = 0;
void (*oldsig)(int sig) = SIG_DFL;
oldsig = signal(SIGINT,Handler);
for (i = 1; i <= 10; ++i)
{
(void) printf("Press Ctrl-C to n'rupt %d\n",i);
(void) sleep(1);
}
(void) signal(SIGINT,oldsig);
return(0);
}
--------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2007 02:33 AM
03-13-2007 02:33 AM
Re: warning 604: Pointers are not assignment-compatible
Thanks much.
jls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2007 02:34 AM
03-13-2007 02:34 AM
Re: warning 604: Pointers are not assignment-compatible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2007 02:39 AM
03-13-2007 02:39 AM
Re: warning 604: Pointers are not assignment-compatible
The type of your signal handler function is slightly wrong: it should be defined as void proc(int);
The integer will be a signal number. This is so that you can code one "master signal handler" function and register it to catch all signals you're interested in, and the handler function can tell which signal it is processing.
This difference in types might be the cause of the warning.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2007 02:45 AM
03-13-2007 02:45 AM
Re: warning 604: Pointers are not assignment-compatible
Thanks for watching out for me :-)