File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1740,8 +1740,17 @@ by the linker, consider running `compileAttributes()` twice. Deleting
1740
1740
1741
1741
## Can we use exceptions and stop() across shared libraries?
1742
1742
1743
- No, sadly. A known limitation coming from the operating system, Windows in
1744
- particular. Exceptions cannot be caught safely as R is statically linked
1745
- with ` libgcc ` there. Some more background is [ in this SO
1743
+ Within limits, yes. Code that is generated via Rcpp Attributes (see
1744
+ \citet{CRAN:Rcpp: Attributes } and Section~ \ref{using-attributes}) generally
1745
+ handles this correctly and gracefully via the ` try-catch ` layer it adds
1746
+ shielding the exception from propagating to another, separate dynamic
1747
+ library.
1748
+
1749
+ However, this mechanism relies on dynamic linking with the (system library)
1750
+ ` libgcc ` providing the C++ standard library (as well as on using the same C++
1751
+ standard library across all compiled components). But this library is linked
1752
+ statically on Windows putting a limitation on the use of ` stop() ` from within
1753
+ Rcpp Modules \citep{CRAN:Rcpp: Modules }. Some more background on the linking
1754
+ requirement is [ in this SO
1746
1755
question] ( https://stackoverflow.com/questions/2424836/exceptions-are-not-caught-in-gcc-program ) .
1747
1756
You can’t perform that action at this time.
0 commit comments