-
-
Notifications
You must be signed in to change notification settings - Fork 219
Closed
Description
When writing a try()
function to check for compile errors from sourceCpp
the compilation error is always printed to the console, regardless of whichever combinations of try()
, suppressMessages()
, suppressWarnings()
or sink
are used.
Reprex:
dcode <- "//[[Rcpp::export]]\n int fun(int x) { const int y; return x; }"
status <- suppressWarnings(suppressMessages(
output <- capture.output(
try(Rcpp::sourceCpp(code = dcode, verbose=FALSE, echo=FALSE),
silent = TRUE))
))
Created on 2023-03-24 with reprex v2.0.2
fileeed07e197428.cpp:2:29: error: default initialization of an object of const type 'const int'
int fun(int x) { const int y; return x; }
^
= 0
1 error generated.
make: *** [fileeed07e197428.o] Error 1
Metadata
Metadata
Assignees
Labels
No labels