[R-pkg-devel] duplicating gcc-UBSAN warning
? Thu, 12 Dec 2024 14:46:08 +0000 Brad Eck <bradleyjeck at gmail.com> ?????:
The flag appears in 00install.out, but the warning doesn't get raised. Any ideas on how to duplicate?
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 [*].
Best regards, Ivan [*] https://cran.r-project.org/doc/manuals/R-exts.html#Using-Address-Sanitizer