Skip to content

replace sprintf in H3Index.c h3ToString() #6

@dcooley

Description

@dcooley

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

checking compiled code ... WARNING
  Fileh3lib/libs/h3lib.so:
    Found_sprintf’, possibly fromsprintf’ (C)
      Object:h3Index.oCompiled 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.

  • Make a PR into H3?
  • Update it locally, plus our update script?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions