File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 2121#define Rcpp_macros_mask_h
2222
2323#ifndef RCPP_NO_MASK_RF_ERROR
24- /** cannot emit a message, no warning yet
24+ #ifdef RCPP_MASK_RF_ERROR
2525#define Rf_error (...) \
2626 _Pragma("GCC warning \"Use of Rf_error() instead of Rcpp::stop(). Calls \
2727to Rf_error() in C++ contexts are unsafe: consider using Rcpp::stop() instead, \
2828or define RCPP_NO_MASK_RF_ERROR if this is a false positive. More info:\n\
2929 - https://github.com/RcppCore/Rcpp/issues/1247\n\
3030 - https://github.com/RcppCore/Rcpp/pull/1402\"") \
3131 Rf_error(__VA_ARGS__)
32- **/
32+ #endif
3333#endif
3434
3535#endif
Original file line number Diff line number Diff line change 1+ #include < Rcpp.h>
2+ using namespace Rcpp ;
3+
4+ struct A {
5+ A () { Rprintf (" A()\n " ); }
6+ ~A () { Rprintf (" ~A()\n " ); }
7+ };
8+
9+ // [[Rcpp::export]]
10+ void uhoh () {
11+ A a;
12+ Rprintf (" Before error\n " );
13+ :: Rf_error (" %s: %d" , " asdf" , 3 );
14+ }
15+
16+ /* ** R
17+ uhoh()
18+ */
You can’t perform that action at this time.
0 commit comments