home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / gcc / help / 2062 < prev    next >
Encoding:
Text File  |  1992-09-04  |  1.1 KB  |  45 lines

  1. Path: sparky!uunet!decwrl!concert!duke!news.duke.edu!acpub.duke.edu!tcamp
  2. From: tcamp@acpub.duke.edu (Ted A. Campbell)
  3. Newsgroups: gnu.gcc.help
  4. Subject: Help with GCC -ansi signal() parameter
  5. Message-ID: <5105@news.duke.edu>
  6. Date: 4 Sep 92 12:22:12 GMT
  7. Sender: news@news.duke.edu
  8. Lines: 34
  9. Nntp-Posting-Host: raphael.acpub.duke.edu
  10.  
  11. I'm receiving a warning message when I compile the following bit
  12. of code. The message is that the second parameter to signal()
  13. ("handler") is of an incompatible type.  I'm using the command
  14. line "gcc -O -ansi filename.c" to compile this. I've tried
  15. making the interrupt handler return void rather than int, 
  16. but the warning message persists.  The program seems to work
  17. ok (this is of course extracted from a larger program), but
  18. I'd like to know how I can avoid this error message.
  19.  
  20. Ted Campbell
  21. Duke University
  22. tcamp@acpub.duke.edu
  23.  
  24. code follows:
  25.  
  26. #include "stdio.h"
  27. #include "stdlib.h"
  28. #include "signal.h"
  29.  
  30. extern int handler( void );
  31.  
  32. void
  33. main( argc, argv )
  34.    int argc;
  35.    char **argv;
  36.    {
  37.    signal( SIGINT, handler );
  38.    }
  39.  
  40.  
  41. int
  42. handler( void )
  43.    {
  44.    }
  45.