Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

sourceCpp compile error stderr cannot be caught/suppressed #1257

Closed
@andrjohns

Description

@andrjohns

When writing atry() function to check for compile errors fromsourceCpp the compilation error is always printed to the console, regardless of whichever combinations oftry(),suppressMessages(),suppressWarnings() orsink 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 withreprex v2.0.2

Standard output and standard error
fileeed07e197428.cpp:2:29: error: default initialization of an object of consttype'const int' int fun(int x) { const int y;return x; }                            ^                              = 01 error generated.make:*** [fileeed07e197428.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp