Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime type mismatch: throw error if NDBEUG is unset? #857

Closed
jackwasey opened this Issue May 31, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@jackwasey
Copy link
Contributor

jackwasey commented May 31, 2018

While debugging, I get runtime errors like:

Not compatible with requested type: [type=character; target=integer]

Would it be possible for Rcpp to hard-stop, like C++ assert does, in the case that compilation uses -UNDEBUG? This would be useful for debugging with gdb or lldb, and give a line number in the source code where the problem was encountered.

@eddelbuettel

This comment has been minimized.

Copy link
Member

eddelbuettel commented May 31, 2018

Not sure. assert() and alike are frowned upon by CRAN Policy.

@jackwasey

This comment has been minimized.

Copy link
Contributor Author

jackwasey commented Jun 1, 2018

Yes, I think so, but they compile (and I believe default R installs, also) use -DNDEBUG, so what I imagined was just Rcpp-based package developers enabling it while debugging.

@eddelbuettel

This comment has been minimized.

Copy link
Member

eddelbuettel commented Jun 1, 2018

You could try with one or two and see -- some things "they" check are text based, some look at the shared library resulting from it. I think you are correct in that this test is based on the shared library.

@jackwasey

This comment has been minimized.

Copy link
Contributor Author

jackwasey commented Jun 1, 2018

Ah, I see. Will take a look.

@eddelbuettel

This comment has been minimized.

Copy link
Member

eddelbuettel commented Jun 9, 2018

Fixed via #860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.