-
Notifications
You must be signed in to change notification settings - Fork 13
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
Compile R with debugging flags #4
Comments
I've added |
@wch It seems the macro is not currently active in these debug builds. Here I'm attaching a sample package which should trigger an assertion error for out-of-bounds access of a vector element when running the examples. There is no assertion error when testing the example, nor when installing the package and calling the function. |
@david-cortes I removed those flags because of #5. It is possible that the issue has been fixed by now in R itself and we can add those flags back, but I currently don't have time to test that out. If you test it out and you run |
Consider compiling all builds with
_GLIBCXX_ASSERTIONS
and possibly_GLIBCXX_DEBUG
. This will help catch some C++ errors earlier on. (For example, rstudio/httpuv#133.)https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html
Note that
_GLIBCXX_DEBUG
, the documentation says, "this flag changes the sizes and behavior of standard class templates such as std::vector, and therefore you can only link code compiled with debug mode and code compiled without debug mode if no instantiation of a container is passed between the two translation units."https://gcc.gnu.org/onlinedocs/libstdc++/manual/debug_mode_using.html
The text was updated successfully, but these errors were encountered: