This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: (lack of) Thread-safe exceptions on AIX (gcc-2.95.1)


>>>>> Marc Lehmann writes:

Marc> Could you send an example, if you have one?

	I am not an expert on Microsoft C Structured Exception Handling,
but it basically is the same syntax as in the C++ standard (adapted from
Modula-2+).

The additional keywords are:

try
except
finally
leave


Here are some examples that someone sent me a long time ago:

try {
    do {
        try {
            delta = f(delta, ...);
        }
        except (GetExceptionCode() == STATUS_FLOATING_OVERFLOW) {
            delta = 0.0;
        }
    } while (delta > epsilon);
}
except (1) {
    return failure_status;
}


try {
    // initialize resources, no allocation
    try {
        // allocate resources
	// do work
    }
    finally {
        // free resources
    }
}
except (GetExceptionCode() == FAIL) {
    // log error
    return failure;
}
return success;


David

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]