diff options
author | Petr Hosek <phosek@chromium.org> | 2018-05-22 02:53:32 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2018-05-22 02:53:32 +0000 |
commit | 6418b4a6af48080f43e40a82cbd14600a9a75b94 (patch) | |
tree | a8dd023ca2fa1928a59ac68245f99194f50875c3 /cmake/Modules/CompilerRTUtils.cmake | |
parent | e3c8c25f305b6013e047407818730acd83f9b3b6 (diff) |
[CMake] Silence unused variable warning in compiler check
This is breaking the compiler check.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332936 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules/CompilerRTUtils.cmake')
-rw-r--r-- | cmake/Modules/CompilerRTUtils.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake index 506c06b60..ee1644ba6 100644 --- a/cmake/Modules/CompilerRTUtils.cmake +++ b/cmake/Modules/CompilerRTUtils.cmake @@ -131,11 +131,11 @@ macro(test_target_arch arch def) if(SANITIZER_CXX_ABI_INTREE) # We're using in tree C++ ABI, only test the C compiler for now. set(TARGET_${arch}_FILENAME "${TARGET_${arch}_NAME}/CheckTarget.c") - file(WRITE "${TARGET_${arch}_FILENAME}" "#include <stdlib.h>\nint main() { void *p = malloc(1); return 0; }\n") + file(WRITE "${TARGET_${arch}_FILENAME}" "#include <stdlib.h>\nint main() { (void)malloc(sizeof(int)); return 0; }\n") else() # We're using the system C++ ABI, test that we can build C++ programs. set(TARGET_${arch}_FILENAME "${TARGET_${arch}_NAME}/CheckTarget.cpp") - file(WRITE "${TARGET_${arch}_FILENAME}" "#include <new>\nint main() { int *p = new int; return 0; }\n") + file(WRITE "${TARGET_${arch}_FILENAME}" "#include <new>\nint main() { (void) new int; return 0; }\n") endif() set(TARGET_${arch}_CFLAGS ${ARGN}) |