$ R CMD SHLIB try_catch.c
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -fPIC -g -O3 -Wall -pipe -c try_catch.c -o try_catch.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -L/usr/local/lib -o try_catch.so try_catch.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
When throwing a real condition, e.g. a simpleError, I can get hold of it
romain@naxos /tmp $ Rscript -e "dyn.load('try_catch.so') ; .Call( 'test', 1L)"