Skip to content

Commit 699fc0a

Browse files
committed
correct calls to Rf_warning (closes #776)
1 parent fc3c0ed commit 699fc0a

File tree

4 files changed

+32
-24
lines changed

4 files changed

+32
-24
lines changed

ChangeLog

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
2017-11-25 Dirk Eddelbuettel <[email protected]>
2+
3+
* DESCRIPTION (Version, Date): Roll minor version
4+
5+
* inst/include/Rcpp/exceptions/cpp11/exceptions.h: Ensure Rf_format gets
6+
a format string
7+
* inst/include/Rcpp/exceptions/cpp98/exceptions.h (Rcpp): Ditto
8+
19
2017-11-18 Dirk Eddelbuettel <[email protected]>
210

311
* DESCRIPTION (Version, Date): Roll minor version
4-
12+
513
* vignettes/Rcpp-FAQ.Rmd: Use Rcpp::Rcpp.plugin.maker(), not ':::'
614

715
2017-11-17 Dirk Eddelbuettel <[email protected]>

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 0.12.14.1
4-
Date: 2017-11-18
3+
Version: 0.12.14.2
4+
Date: 2017-11-25
55
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,
66
Nathan Russell, Douglas Bates and John Chambers
77
Maintainer: Dirk Eddelbuettel <[email protected]>

inst/include/Rcpp/exceptions/cpp11/exceptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class __CLASS__ : public std::exception {
4444

4545
template <typename... Args>
4646
inline void warning(const char* fmt, Args&&... args ) {
47-
Rf_warning( tfm::format(fmt, std::forward<Args>(args)... ).c_str() );
47+
Rf_warning("%s", tfm::format(fmt, std::forward<Args>(args)... ).c_str());
4848
}
4949

5050
template <typename... Args>

inst/include/Rcpp/exceptions/cpp98/exceptions.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,52 +70,52 @@ class __CLASS__ : public std::exception{
7070

7171
template <typename T1>
7272
inline void warning(const char* fmt, const T1& arg1) {
73-
Rf_warning( tfm::format(fmt, arg1 ).c_str() );
73+
Rf_warning("%s", tfm::format(fmt, arg1).c_str());
7474
}
7575

7676
template <typename T1, typename T2>
7777
inline void warning(const char* fmt, const T1& arg1, const T2& arg2) {
78-
Rf_warning( tfm::format(fmt, arg1, arg2 ).c_str() );
78+
Rf_warning("%s", tfm::format(fmt, arg1, arg2).c_str());
7979
}
8080

8181
template <typename T1, typename T2, typename T3>
8282
inline void warning(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3) {
83-
Rf_warning( tfm::format(fmt, arg1, arg2, arg3).c_str() );
83+
Rf_warning("%s", tfm::format(fmt, arg1, arg2, arg3).c_str());
8484
}
8585

8686
template <typename T1, typename T2, typename T3, typename T4>
8787
inline void warning(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4) {
88-
Rf_warning( tfm::format(fmt, arg1, arg2, arg3, arg4).c_str() );
88+
Rf_warning("%s", tfm::format(fmt, arg1, arg2, arg3, arg4).c_str());
8989
}
9090

9191
template <typename T1, typename T2, typename T3, typename T4, typename T5>
9292
inline void warning(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4, const T5& arg5) {
93-
Rf_warning( tfm::format(fmt, arg1, arg2, arg3, arg4, arg5).c_str() );
93+
Rf_warning("%s", tfm::format(fmt, arg1, arg2, arg3, arg4, arg5).c_str());
9494
}
9595

9696
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
9797
inline void warning(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4, const T5& arg5, const T6& arg6) {
98-
Rf_warning( tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6).c_str() );
98+
Rf_warning("%s", tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6).c_str());
9999
}
100100

101101
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
102102
inline void warning(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4, const T5& arg5, const T6& arg6, const T7& arg7) {
103-
Rf_warning( tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7).c_str() );
103+
Rf_warning("%s", tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7).c_str());
104104
}
105105

106106
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
107107
inline void warning(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4, const T5& arg5, const T6& arg6, const T7& arg7, const T8& arg8) {
108-
Rf_warning( tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8).c_str() );
108+
Rf_warning("%s", tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8).c_str());
109109
}
110110

111111
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
112112
inline void warning(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4, const T5& arg5, const T6& arg6, const T7& arg7, const T8& arg8, const T9& arg9) {
113-
Rf_warning( tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9).c_str() );
113+
Rf_warning("%s", tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9).c_str());
114114
}
115115

116116
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
117117
inline void warning(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4, const T5& arg5, const T6& arg6, const T7& arg7, const T8& arg8, const T9& arg9, const T10& arg10) {
118-
Rf_warning( tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10).c_str() );
118+
Rf_warning("%s", tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10).c_str());
119119
}
120120

121121
// -- End Rcpp::warning declaration
@@ -124,52 +124,52 @@ inline void warning(const char* fmt, const T1& arg1, const T2& arg2, const T3& a
124124

125125
template <typename T1>
126126
inline void NORET stop(const char* fmt, const T1& arg1) {
127-
throw Rcpp::exception( tfm::format(fmt, arg1 ).c_str() );
127+
throw Rcpp::exception(tfm::format(fmt, arg1).c_str());
128128
}
129129

130130
template <typename T1, typename T2>
131131
inline void NORET stop(const char* fmt, const T1& arg1, const T2& arg2) {
132-
throw Rcpp::exception( tfm::format(fmt, arg1, arg2 ).c_str() );
132+
throw Rcpp::exception(tfm::format(fmt, arg1, arg2).c_str());
133133
}
134134

135135
template <typename T1, typename T2, typename T3>
136136
inline void NORET stop(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3) {
137-
throw Rcpp::exception( tfm::format(fmt, arg1, arg2, arg3).c_str() );
137+
throw Rcpp::exception(tfm::format(fmt, arg1, arg2, arg3).c_str());
138138
}
139139

140140
template <typename T1, typename T2, typename T3, typename T4>
141141
inline void NORET stop(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4) {
142-
throw Rcpp::exception( tfm::format(fmt, arg1, arg2, arg3, arg4).c_str() );
142+
throw Rcpp::exception(tfm::format(fmt, arg1, arg2, arg3, arg4).c_str());
143143
}
144144

145145
template <typename T1, typename T2, typename T3, typename T4, typename T5>
146146
inline void NORET stop(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4, const T5& arg5) {
147-
throw Rcpp::exception( tfm::format(fmt, arg1, arg2, arg3, arg4, arg5).c_str() );
147+
throw Rcpp::exception(tfm::format(fmt, arg1, arg2, arg3, arg4, arg5).c_str());
148148
}
149149

150150
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
151151
inline void NORET stop(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4, const T5& arg5, const T6& arg6) {
152-
throw Rcpp::exception( tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6).c_str() );
152+
throw Rcpp::exception(tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6).c_str());
153153
}
154154

155155
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
156156
inline void NORET stop(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4, const T5& arg5, const T6& arg6, const T7& arg7) {
157-
throw Rcpp::exception( tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7).c_str() );
157+
throw Rcpp::exception(tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7).c_str());
158158
}
159159

160160
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
161161
inline void NORET stop(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4, const T5& arg5, const T6& arg6, const T7& arg7, const T8& arg8) {
162-
throw Rcpp::exception( tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8).c_str() );
162+
throw Rcpp::exception(tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8).c_str());
163163
}
164164

165165
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
166166
inline void NORET stop(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4, const T5& arg5, const T6& arg6, const T7& arg7, const T8& arg8, const T9& arg9) {
167-
throw Rcpp::exception( tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9).c_str() );
167+
throw Rcpp::exception(tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9).c_str());
168168
}
169169

170170
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
171171
inline void NORET stop(const char* fmt, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4, const T5& arg5, const T6& arg6, const T7& arg7, const T8& arg8, const T9& arg9, const T10& arg10) {
172-
throw Rcpp::exception( tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10).c_str() );
172+
throw Rcpp::exception(tfm::format(fmt, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10).c_str());
173173
}
174174

175175
// -- End Rcpp::stop declaration

0 commit comments

Comments
 (0)