Dear Dan,
As the warning says, the binary notation you use is only valid with
C++14 and onwards. You can either add SystemRequirements: C++14 to
your DESCRIPTION file, or use decimal (or hex) notation.
In my opinion it's even better to name your constants to convey their
meaning to the reader of the code. Then it wouldn't be a big issue if
you use binary, decimal, or hex notation.
Best,
David
On Sat, Nov 21, 2020 at 4:59 PM Dan Zigmond <djz at shmonk.com> wrote:
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
sort.cpp:12:43: warning: binary constants are a C++14 feature or GCC
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 at shmonk.com
[[alternative HTML version deleted]]