exceptions4c
exceptions4c copied to clipboard
Signal is not handled twice with a specific order of headers.
Consider the following program:
#include "e4c.h"
#include <stdio.h>
#include <stdlib.h>
void run(){
e4c_using_context(E4C_TRUE){
try{
int *s = NULL;
*s = 0;
}catch(BadPointerException){
printf("signal handled\n");
}
}
}
void main(){
run();
run();
}
The first signal is handled while the second is not. It crashes the program with SIGSEGV. This also happens in the case of ArithemticException (dividing by zero for instance). Place "e4c.h" after the standard headers and the program works as it should do.