Changeset 2576 for zzuf/trunk/test


Ignore:
Timestamp:
Jul 20, 2008, 12:19:06 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • bug-div0.c: raise SIGFPE manually since Darwin won't trap on 1/0.
File:
1 edited

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;
Note: See TracChangeset for help on using the changeset viewer.