scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

0001-abort.c (281B)


      1 #include <assert.h>
      2 #include <stdio.h>
      3 #include <signal.h>
      4 #include <stdlib.h>
      5 
      6 /*
      7 output:
      8 aborting
      9 end:
     10 */
     11 
     12 void
     13 handler(int dummy)
     14 {
     15 	_Exit(0);
     16 }
     17 
     18 int
     19 main(void)
     20 {
     21 	printf("aborting\n");
     22 	assert(signal(SIGABRT, handler) != SIG_ERR);
     23 	abort();
     24 	printf("borning\n");
     25 
     26 	return 0;
     27 }