Skip to content

-Wformat warning from include/Rcpp/date_datetime/date_datetime.h:29 #1447

@pjonsson

Description

@pjonsson

I enabled some more warnings when compiling a package that uses Rcpp and got this warning which seems to be caused by Rcpp itself:

In file included from /usr/local/lib/R/site-library/Rcpp/include/Rcpp/date_datetime/date_datetime.h:29:
/usr/local/lib/R/site-library/Rcpp/include/Rcpp/date_datetime/Datetime.h:83:65: warning: format specifies type 'int' but the argument has type 'unsigned int' [-Wformat]
   83 |                 res = ::snprintf(txtsec, 63, "%s.%06d", txtiso, m_us);
      |                                                  ~~~~           ^~~~
      |                                                  %06u

It probably doesn't make any practical difference for the result, but it's nice if Rcpp itself doesn't trigger common compiler warnings.

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