[PATCH] D74460: Use pure C for "try_compile"

LJC via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 21:07:34 PST 2020


paperchalice created this revision.
paperchalice added a reviewer: samsonov.
Herald added subscribers: llvm-commits, Sanitizers, mgorny.
Herald added projects: Sanitizers, LLVM.

The code in "simple.cc" use "stdio.h" and "stdlib.h", which are deprecated in future C++. File with suffix ".cc" may be recognized as a C++ source, may causes error.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74460

Files:
  compiler-rt/cmake/config-ix.cmake


Index: compiler-rt/cmake/config-ix.cmake
===================================================================
--- compiler-rt/cmake/config-ix.cmake
+++ compiler-rt/cmake/config-ix.cmake
@@ -169,2 +169,2 @@
-set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.cc)
-file(WRITE ${SIMPLE_SOURCE} "#include <stdlib.h>\n#include <stdio.h>\nint main() { printf(\"hello, world\"); }\n")
+set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.c)
+file(WRITE ${SIMPLE_SOURCE} "#include <stddef.h>\nint main(void) { return 0; }\n")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74460.244060.patch
Type: text/x-patch
Size: 552 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200212/cf3ce620/attachment.bin>


More information about the llvm-commits mailing list