Skip to content

Commit 7653032

Browse files
committed
Revert "emit a message instead of a warning using an internal wrapper"
This reverts commit 9d409e8.
1 parent b6623b7 commit 7653032

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

ChangeLog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
2025-11-12 Iñaki Ucar <[email protected]>
9393

9494
* inst/include/Rcpp/macros/mask.h: Lay the ground for Rf_error masking
95-
with a message at compilation time unless RCPP_NO_MASK_RF_ERROR is defined
95+
with a warning at compilation time unless RCPP_NO_MASK_RF_ERROR is defined
9696
* inst/include/RcppCommon.h: Include the previous file in the last place
9797
* src/attributes.cpp: Use parentheses to protect call to Rf_error
9898
* inst/tinytest/cpp/stack.cpp: Idem

inst/include/Rcpp/macros/mask.h

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,14 @@
2020
#ifndef Rcpp_macros_mask_h
2121
#define Rcpp_macros_mask_h
2222

23-
namespace Rcpp {
24-
namespace internal {
25-
26-
template<typename... Args>
27-
void Rf_error(const char *format, Args... args) {
28-
::Rf_error(format, args...);
29-
#ifndef COMPILING_RCPP
30-
# pragma message "Use of Rf_error() instead of Rcpp::stop(). Calls \
23+
#ifndef RCPP_NO_MASK_RF_ERROR
24+
#define Rf_error(...) \
25+
_Pragma("GCC warning \"Use of Rf_error() instead of Rcpp::stop(). Calls \
3126
to Rf_error() in C++ contexts are unsafe: consider using Rcpp::stop() instead, \
3227
or define RCPP_NO_MASK_RF_ERROR if this is a false positive. More info:\n\
3328
- https://github.com/RcppCore/Rcpp/issues/1247\n\
34-
- https://github.com/RcppCore/Rcpp/pull/1402"
35-
#endif
36-
}
37-
38-
} // internal
39-
} // Rcpp
40-
41-
#ifndef RCPP_NO_MASK_RF_ERROR
42-
#define Rf_error(...) Rcpp::internal::Rf_error(__VA_ARGS__)
29+
- https://github.com/RcppCore/Rcpp/pull/1402\"") \
30+
Rf_error(__VA_ARGS__)
4331
#endif
4432

4533
#endif

0 commit comments

Comments
 (0)