[PATCH] D61797: [crt] Use -std=c99 for crtbegin.o/crtend.o

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 11:57:04 PDT 2019


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

The source uses C99 syntax such as comments and some compilers print
warnings without specifying this flag.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D61797

Files:
  compiler-rt/lib/crt/CMakeLists.txt


Index: compiler-rt/lib/crt/CMakeLists.txt
===================================================================
--- compiler-rt/lib/crt/CMakeLists.txt
+++ compiler-rt/lib/crt/CMakeLists.txt
@@ -71,6 +71,7 @@
 check_cxx_section_exists(".init_array" COMPILER_RT_HAS_INITFINI_ARRAY
   SOURCE "__attribute__((constructor)) void f() {}\nint main() { return 0; }\n")
 
+set(CRT_CFLAGS -std=c99)
 append_list_if(COMPILER_RT_HAS_INITFINI_ARRAY -DCRT_HAS_INITFINI_ARRAY CRT_CFLAGS)
 append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC CRT_CFLAGS)
 append_list_if(COMPILER_RT_HAS_WNO_PEDANTIC -Wno-pedantic CRT_CFLAGS)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61797.199047.patch
Type: text/x-patch
Size: 602 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190510/5091ddd9/attachment.bin>


More information about the llvm-commits mailing list