Changeset 2576

Show
Ignore:
Timestamp:
07/20/08 12:19:06 (3 months ago)
Author:
sam
Message:
  • bug-div0.c: raise SIGFPE manually since Darwin won't trap on 1/0.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/test/bug-div0.c

    r2545 r2576  
    1717#include <stdio.h> 
    1818#include <stdlib.h> 
     19#include <signal.h> 
    1920 
    2021int buf[1]; 
     
    2526 
    2627    while((ch = getc(stdin)) != EOF) 
     28    { 
    2729        buf[0] = 1 / !ch; 
     30        if(ch) raise(SIGFPE); /* Needed on OS X... sigh. */ 
     31    } 
    2832 
    2933    return EXIT_SUCCESS;