[R-pkg-devel] CRAN check FAIL due to pragmas in headers and code

Dirk Eddelbuettel edd at debian.org
Thu Dec 14 01:13:31 CET 2017

On 14 December 2017 at 00:58, Iñaki Úcar wrote:
| Hi all,
| Three days ago, Patrick Perry posted the following on R-devel:
| 2017-12-11 16:32 GMT+01:00 Patrick Perry <pperry at stern.nyu.edu>:
| > A recent change to r-devel causes an R CMD check warning when a C file
| > includes a "#pragma GCC diagnostic ignored" pragma:
| > https://github.com/wch/r-source/commit/b76c8fd355a0f5b23d42aaf44a879cac0fc31fa4
| > . This causes the CRAN checks for the "corpus" package to emit a warning:
| > https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-fedora-clang/corpus-00check.html
| I didn't pay much attention, but today I received a couple of emails
| warning about my package failing on r-devel-linux-x86_64-debian (gcc
| and clang) with the following message:
| Check: pragmas in C/C++ headers and code
| Result: FAIL
| My package has no pragmas, but Rcpp, on which it depends, does. So

But for the record (and using ag(1) as a better grep):

  edd at bud:~/git/rcpp(master)$ ag pragma
  35:# pragma push_macro("major")
  40:# pragma push_macro("minor")
  45:# pragma push_macro("makedev")
  73:# pragma pop_macro("major")
  77:# pragma pop_macro("minor")
  81:# pragma pop_macro("makedev")
  191:#       pragma warning(push)
  192:#       pragma warning(disable:4244)
  193:#       pragma warning(disable:4267)
  202:#       pragma warning(pop)

  62:#pragma omp parallel for shared(x, n)

  88:#pragma omp parallel for \
  edd at bud:~/git/rcpp(master)$

The ones in headers.h are innocent, the ones in tinyformat are #ifdef'ed away
for another OS, and the remaining two are for OpenMP.

So your statement "Rcpp does [have #pragma]" is narrowly correct, but still
totally irrelevant as the CRAN Policy issue (and recent change) is enirely
about _#pragma use to turn compiler diagnostics off_.  Which we don't do here. 


| basically Rcpp and all packages depending on Rcpp are failing on that
| flavors. Is this a new requirement for new submissions? Or should I
| ignore these FAILs?
| Regards,
| Iñaki
| ______________________________________________
| R-package-devel at r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-package-devel
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

More information about the R-package-devel mailing list