From 78a8827fd4d4c814e63a8670cf88453f1586f4c5 Mon Sep 17 00:00:00 2001 From: George Kadianakis Date: Mon, 25 Feb 2019 15:29:41 +0200 Subject: [PATCH 1/2] Silence unneeded clang warns that triggered in prob distr tests. See https://trac.torproject.org/projects/tor/ticket/29528#comment:3 and https://bugs.llvm.org/show_bug.cgi?id=19535 --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 91a0498440..0f7eb61f25 100644 --- a/configure.ac +++ b/configure.ac @@ -1198,6 +1198,11 @@ if test "$fragile_hardening" = "yes"; then AC_MSG_ERROR([The compiler supports -fsanitize=undefined, but for some reason I was not able to link when using it. Are you missing run-time support? With GCC you need libasan.*, and with Clang you need libclang_rt.ubsan*]) fi + TOR_TRY_COMPILE_WITH_CFLAGS([-fno-sanitize=float-divide-by-zero], also_link, CFLAGS_UBSAN="-fno-sanitize=float-divide-by-zero", true) + if test "$tor_cv_cflags__fno_sanitize_float_divide_by_zero" = "yes" && test "$tor_can_link__fno_sanitize_float_divide_by_zero" != "yes"; then + AC_MSG_ERROR([The compiler supports -fno-sanitize=float-divide-by-zero, but for some reason I was not able to link when using it. Are you missing run-time support? With GCC you need libasan.*, and with Clang you need libclang_rt.ubsan*]) + fi + TOR_CHECK_CFLAGS([-fno-omit-frame-pointer]) fi From cfcf6de1a83ebb192374836a8c35a317fc2894e1 Mon Sep 17 00:00:00 2001 From: teor Date: Wed, 20 Mar 2019 18:07:00 +1000 Subject: [PATCH 2/2] Changes file for bug 29527 The previous commit introduces these changes: Stop warning about undefined behavior in the probability distribution tests. Float division by zero may technically be undefined behaviour in C, but it's well-defined in IEEE 754. Partial backport of 29298. Closes ticket 29527; bugfix on 0.4.0.1-alpha. --- changes/bug29527 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changes/bug29527 diff --git a/changes/bug29527 b/changes/bug29527 new file mode 100644 index 0000000000..6f36a9e1a0 --- /dev/null +++ b/changes/bug29527 @@ -0,0 +1,5 @@ + o Minor features (circuit padding): + - Stop warning about undefined behavior in the probability distribution + tests. Float division by zero may technically be undefined behaviour in + C, but it's well-defined in IEEE 754. Partial backport of 29298. + Closes ticket 29527; bugfix on 0.4.0.1-alpha.