[R-pkg-devel] truncating strings on purpose

Ivan Krylov |kry|ov @end|ng |rom d|@root@org
Mon Dec 16 16:36:25 CET 2024


Dear Brad, Kurt,

В Fri, 13 Dec 2024 18:08:27 +0000
Brad Eck <bradleyjeck using gmail.com> пишет:

> The bad news is that following the gcc docs on avoid the warning did
> not seem to work:

I have asked on Libera.Chat's #gcc and was told that the "middle-end"
warnings [1] (which include -Wstringop-truncation) should not count as
failures when Address Sanitizer is enabled. (Many thanks to Sam James
and Arsen Arsenović for the triage!) While we don't literally use
-Werror, de-facto the result is the same: the package doesn't pass the
check if the warning is emitted.

The reason for that is that the "middle-end" warnings require
optimisation to avoid false positives in the unreachable code paths,
and sanitizers change optimisation too much for the warnings to remain
reliable [2]. A similar false positive has been reported before [3].

Can we use -Wno-stringop-truncation during incoming checks with ASan?

-- 
Best regards,
Ivan

[1]
https://developers.redhat.com/blog/2019/03/13/understanding-gcc-warnings-part-2

[2]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117881

[3]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108939



More information about the R-package-devel mailing list