ThrowTheSwitch / CException

Lightweight exception implementation for C
http://throwtheswitch.org
MIT License
326 stars 66 forks source link

Test test_CanHaveNestedTryBlocksInASingleFunction_ThrowOutside fails with O2 or O3 optimization levels #28

Closed cchciose closed 8 months ago

cchciose commented 1 year ago

As mentioned in the title, the test test_CanHaveNestedTryBlocksInASingleFunction_ThrowOutside (file TestException.c) fails if compiled with -O2 or -O3.

This is due to the volatile qualifier missing when declaring int i = 0; (line 284).

The test succeeds if i is declared as volatile.

This is documented in docs/CException.md, Limitations point 2.