[R-pkg-devel] warning: binary constants are a C++14 feature or GCC extension

Dan Zigmond djz @end|ng |rom @hmonk@com
Sun Nov 22 01:59:14 CET 2020


Hi, all. In re-submitting a package to CRAN, I'm getting the following
warnings in the Debian pre-test:

Found the following significant warnings:
  sort.cpp:12:28: warning: binary constants are a C++14 feature or GCC extension
  sort.cpp:12:43: warning: binary constants are a C++14 feature or GCC extension

I added some C++ code to speed up the package and the warnings refer to
this line of C++:

   while ((s[p + length] & 0b11000000) == 0b10000000) {

The line has to do with parsing UTF-8 strings by figuring out how many
bytes are used in each character. Is the 0b... notation not allowed in
CRAN? I could substitute decimal constants, but that will be a bit more
obtuse. The other platforms seems to allow this; only the Debian check
failed.

     Dan

.
--------------------------
Dan Zigmond
djz using shmonk.com

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list