Patch cord.h to remove CRAN warning #228
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #223.
This warning is occurring because Abseil does C++ trickery to inline character data into its "cord" data structure. S2 uses the "strings" module from Abseil for its logging and its text format parsing/generation. We explicitly turn off logging and don't use S2's text format and thus the piece of code in question is never called.
This "fix" just comments out the line and throws an exception if for some unforseen reason that method actually actually does get called. In that case the error should propagate up to the top level catch provided by Rcpp.
The real fix is to update Abseil; however, updating Abseil means we can no longer support C++11 (we're using the last version of Abseil that does support C++11; subsequent versions require C++14). That would mean that s2 (and its reverse dependency sf) may have trouble building on Centos 7 (e.g., many compute clusters). Centos 7 isn't EOL until June 2024, so it may be worth considering making s2 an optional dependency of sf instead of a hard one (cc @edzer ). There is a workaround (use something called devtoolset 8 which allows using the Centos 8 toolchain to compile stuff for Centos 7).