Skip to content
Prev 11103 / 12125 Next

[R-pkg-devel] duplicating gcc-UBSAN warning

? Thu, 12 Dec 2024 14:46:08 +0000
Brad Eck <bradleyjeck at gmail.com> ?????:
In my experiments with gcc 14.2.0-8 on Debian for amd64 (the
debian:testing container), the warning only appears when all of the
following flags are present:

-fsanitize=address -O2 -Wstringop-truncation

-Wall can be used instead of -Wstringop-truncation because the former
includes the latter. -fsanitize=address,undefined also works, but not
just -fsanitize=undefined.

Remove the optimisation or the AddressSanitizer, and GCC stops being
able to prove that truncation occurs. It looks like you will either
need to find a container with R pre-built with sanitizers enabled (are
there Rocker containers for aarch64?) or build R yourself [*].