code_junkie

Can I ignore a SIGFPE resulting from division by zero?

Nov 13th, 2011
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <signal.h>
  2. ...
  3. int main(void) {
  4. signal(SIGFPE, SIG_IGN);
  5. ...
  6. }
  7.  
  8. exit()
  9.  
  10. signal(SIGFPE, SIG_IGN);
  11.  
  12. #include <fpu_control.h>
  13.  
  14. _FPU_SETCW (_FPU_DEFAULT);
  15.  
  16. #include <signal.h>
  17.  
  18. #ifdef DEBUG
  19. #define DIE_HERE raise(SIGFPE)
  20. #else
  21. #define DIE_HERE
  22. #endif
Add Comment
Please, Sign In to add comment