SymbolixAU / h3lib

Other
2 stars 0 forks source link

replace `sprintf` in H3Index.c `h3ToString()` #6

Open dcooley opened 1 year ago

dcooley commented 1 year ago

H3Index.c uses sprintf, but this won't pass R Checks (as of R 4.3)

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()

But this means we need to update the H3 source code directly.

dcooley commented 1 year ago

linked issue - https://github.com/uber/h3/issues/774

dcooley commented 1 year ago

I think our best option is to