@@ -203,14 +203,10 @@ void stop [[noreturn]] (const std::string& fmt_arg, Args&&... args) {
203
203
safe.noreturn (Rf_errorcall)(R_NilValue, " %s" , msg.c_str ());
204
204
}
205
205
206
- template <typename ... Args>
207
- void warning (const char * fmt_arg, Args&&... args) {
208
- std::string msg = fmt::format (fmt_arg, std::forward<Args>(args)...);
209
- safe[Rf_warningcall](R_NilValue, " %s" , msg.c_str ());
210
- }
206
+ // Always making copy of string to avoid weird unwind behavior.
211
207
212
208
template <typename ... Args>
213
- void warning (const std::string& fmt_arg, Args&&... args) {
209
+ void warning (const std::string fmt_arg, Args&&... args) {
214
210
std::string msg = fmt::format (fmt_arg, std::forward<Args>(args)...);
215
211
safe[Rf_warningcall](R_NilValue, " %s" , msg.c_str ());
216
212
}
@@ -225,13 +221,10 @@ void stop [[noreturn]] (const std::string& fmt, Args... args) {
225
221
safe.noreturn (Rf_errorcall)(R_NilValue, fmt.c_str (), args...);
226
222
}
227
223
228
- template <typename ... Args>
229
- void warning (const char * fmt, Args... args) {
230
- safe[Rf_warningcall](R_NilValue, fmt, args...);
231
- }
224
+ // Always making copy of string to avoid weird unwind behavior.
232
225
233
226
template <typename ... Args>
234
- void warning (const std::string& fmt, Args... args) {
227
+ void warning (const std::string fmt, Args... args) {
235
228
safe[Rf_warningcall](R_NilValue, fmt.c_str (), args...);
236
229
}
237
230
#endif
0 commit comments