[compiler-rt] 5af1ca8 - Add some prototypes to these checks; NFC

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 9 05:38:40 PDT 2022


Author: Aaron Ballman
Date: 2022-04-09T08:38:29-04:00
New Revision: 5af1ca841f6b029c859044aa43824ad224d9e25f

URL: https://github.com/llvm/llvm-project/commit/5af1ca841f6b029c859044aa43824ad224d9e25f
DIFF: https://github.com/llvm/llvm-project/commit/5af1ca841f6b029c859044aa43824ad224d9e25f.diff

LOG: Add some prototypes to these checks; NFC

This should address a build bot failure:
https://lab.llvm.org/buildbot/#/builders/18/builds/4495

Added: 
    

Modified: 
    compiler-rt/cmake/Modules/CheckSectionExists.cmake
    compiler-rt/lib/crt/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/cmake/Modules/CheckSectionExists.cmake b/compiler-rt/cmake/Modules/CheckSectionExists.cmake
index abfb81cb45895..cb32276b5aee1 100644
--- a/compiler-rt/cmake/Modules/CheckSectionExists.cmake
+++ b/compiler-rt/cmake/Modules/CheckSectionExists.cmake
@@ -1,7 +1,7 @@
 function(check_section_exists section output)
   cmake_parse_arguments(ARG "" "" "SOURCE;FLAGS" ${ARGN})
   if(NOT ARG_SOURCE)
-    set(ARG_SOURCE "int main() { return 0; }\n")
+    set(ARG_SOURCE "int main(void) { return 0; }\n")
   endif()
 
   string(RANDOM TARGET_NAME)

diff  --git a/compiler-rt/lib/crt/CMakeLists.txt b/compiler-rt/lib/crt/CMakeLists.txt
index 0628163659bd1..60b30566b7925 100644
--- a/compiler-rt/lib/crt/CMakeLists.txt
+++ b/compiler-rt/lib/crt/CMakeLists.txt
@@ -35,7 +35,7 @@ if(COMPILER_RT_HAS_CRT)
 
   include(CheckSectionExists)
   check_section_exists(".init_array" COMPILER_RT_HAS_INITFINI_ARRAY
-    SOURCE "volatile int x;\n__attribute__((constructor)) void f() {x = 0;}\nint main() { return 0; }\n")
+    SOURCE "volatile int x;\n__attribute__((constructor)) void f(void) {x = 0;}\nint main(void) { return 0; }\n")
 
   append_list_if(COMPILER_RT_HAS_STD_C11_FLAG -std=c11 CRT_CFLAGS)
   append_list_if(COMPILER_RT_HAS_INITFINI_ARRAY -DCRT_HAS_INITFINI_ARRAY CRT_CFLAGS)


        


More information about the llvm-commits mailing list