Skip to content

Commit

Permalink
[CMAKE] Fix a -Wpointer-to-int-cast when searching Jemalloc
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Fabcien committed Jun 3, 2020
1 parent 091e926 commit 695ac71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmake/utils/CheckJemallocBuilds.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <jemalloc.h>

int main(int argc, char** argv) {
void *volatile dummyPtr = malloc(42);
(void)argv;
return argc + (int)(malloc(42));
return argc;
}

0 comments on commit 695ac71

Please sign in to comment.