On Fri, 1 Nov 2024 09:56:01 +0100 Tomas Kalibera <tomas.kalib...@gmail.com> wrote:
> isn't there a finer-grained way to suppress reports just > of this particular issue, ideally at finer granularity than a > function? The line saying "function:do_dotCode" in the suppression file will suppress errors just for mismatched function pointer types inside do_dotCode(), because "function" is the name of this check [1]. Here's do_dotCode with a different error added: bin/R -q -s -e 'library(survival); survdiff(Surv(futime, fustat) ~ rx,data=ovarian)' dotcode.c:1958:9: runtime error: 1e+100 is outside the range of representable values of type 'int' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior dotcode.c:1958:9 dotcode.c:2012:2: runtime error: call to function survdiff2 through pointer to incorrect function type 'void (*)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *)' /tmp/RtmpVPlRnI/R.INSTALL65eb26c0356f/survival/src/survdiff2.c:10: note: survdiff2 defined here SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior dotcode.c:2012:2 UBSAN_OPTIONS="suppressions=$(realpath dotcode.supp)" \ bin/R -q -s -e 'library(survival); survdiff(Surv(futime, fustat) ~ rx,data=ovarian)' dotcode.c:1958:9: runtime error: 1e+100 is outside the range of representable values of type 'int' I don't think UBSan can suppress errors in a more precise manner. The documentation only mentions files, functions ans libraries. Best I could find was a 2020 comment [2] suggesting to separate the offending code into a function and let the optimiser inline it. -- Best regards, Ivan [1] https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#runtime-suppressions [2] https://bugs.llvm.org/show_bug.cgi?id=19834#c11 ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel