From 695ac71211925139845a00e09f769fb621d201e0 Mon Sep 17 00:00:00 2001 From: Fabien Date: Wed, 3 Jun 2020 17:55:26 +0200 Subject: [PATCH] [CMAKE] Fix a -Wpointer-to-int-cast when searching Jemalloc Summary: This would trigger failures when `-Werror` is enabled, such as: https://build.bitcoinabc.org/viewLog.html?tab=buildLog&logTab=tree&filter=debug&expand=all&buildId=66573&guest=1#footer Test Plan: cmake -GNinja .. \ -DUSE_JEMALLOC_EXPERIMENTAL=ON \ -DCMAKE_C_FLAGS=-Werror This will fail before this patch and succeed after. Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D6343 --- cmake/utils/CheckJemallocBuilds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/utils/CheckJemallocBuilds.c b/cmake/utils/CheckJemallocBuilds.c index 489e55ed..ba4f1ef1 100644 --- a/cmake/utils/CheckJemallocBuilds.c +++ b/cmake/utils/CheckJemallocBuilds.c @@ -1,6 +1,7 @@ #include int main(int argc, char** argv) { + void *volatile dummyPtr = malloc(42); (void)argv; - return argc + (int)(malloc(42)); + return argc; }