Article View: gnu.gcc.help
Article #368Help with GCC -ansi signal() parameter
From: Ted A. Campbell
Date: Fri, 04 Sep 1992 12:22
Date: Fri, 04 Sep 1992 12:22
34 lines
1140 bytes
1140 bytes
I'm receiving a warning message when I compile the following bit
of code. The message is that the second parameter to signal()
("handler") is of an incompatible type. I'm using the command
line "gcc -O -ansi filename.c" to compile this. I've tried
making the interrupt handler return void rather than int,
but the warning message persists. The program seems to work
ok (this is of course extracted from a larger program), but
I'd like to know how I can avoid this error message.
Ted Campbell
Duke University
tcamp@acpub.duke.edu
code follows:
#include "stdio.h"
#include "stdlib.h"
#include "signal.h"
extern int handler( void );
void
main( argc, argv )
int argc;
char **argv;
{
signal( SIGINT, handler );
}
int
handler( void )
{
}
Technical Details
Message-ID:
<5105@news.duke.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!decwrl!concert!duke!news.duke.edu!acpub.duke.edu!tcampShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!concert!duke!news.duke.edu!acpub.duke.edu!tcamp From: tcamp@acpub.duke.edu (Ted A. Campbell) Newsgroups: gnu.gcc.help Subject: Help with GCC -ansi signal() parameter Message-ID: <5105@news.duke.edu> Date: 4 Sep 92 12:22:12 GMT Sender: news@news.duke.edu Lines: 34 Nntp-Posting-Host: raphael.acpub.duke.edu