We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
sprintf
h3ToString()
H3Index.c uses sprintf, but this won't pass R Checks (as of R 4.3)
H3Index.c
checking compiled code ... WARNING File ‘h3lib/libs/h3lib.so’: Found ‘_sprintf’, possibly from ‘sprintf’ (C) Object: ‘h3Index.o’ Compiled code should not call entry points which might terminate R nor write to stdout/stderr instead of to the console, nor use Fortran I/O nor system RNGs nor [v]sprintf.
Reference - https://www.tidyverse.org/blog/2023/03/cran-checks-compiled-code/#warning-regarding-the-use-of-codesprintfcode-in-cc
The solution is to use snprintf()
snprintf()
But this means we need to update the H3 source code directly.
H3
The text was updated successfully, but these errors were encountered:
linked issue - uber/h3#774
Sorry, something went wrong.
h3ToString
I think our best option is to
h3Index.c
//sprintf(str, "%" PRIx64, h); //return E_SUCCESS; return E_FAILED;
init.c
h3r
SEXP h3ToSexpString(H3Index h3) { char str[17]; //h3ToString(h3, str, sizeof(str)); int res = snprintf(str, sizeof(str), "%" PRIx64, h3); return Rf_mkChar(str); }
replacing sprintf #6
6aeb0ca
No branches or pull requests
H3Index.c
usessprintf
, but this won't pass R Checks (as of R 4.3)Reference - https://www.tidyverse.org/blog/2023/03/cran-checks-compiled-code/#warning-regarding-the-use-of-codesprintfcode-in-cc
The solution is to use
snprintf()
But this means we need to update the
H3
source code directly.The text was updated successfully, but these errors were encountered: