[llvm] r312240 - Build LLVM with -Wstrict-prototypes enabled
Alex Lorenz via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 31 06:23:24 PDT 2017
Author: arphaman
Date: Thu Aug 31 06:23:24 2017
New Revision: 312240
URL: http://llvm.org/viewvc/llvm-project?rev=312240&view=rev
Log:
Build LLVM with -Wstrict-prototypes enabled
Clang 5 supports -Wstrict-prototypes. We should use it to catch any C
declarations that declare a non-prototype function.
rdar://33705313
Differential Revision: https://reviews.llvm.org/D36669
Modified:
llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=312240&r1=312239&r2=312240&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Thu Aug 31 06:23:24 2017
@@ -581,6 +581,8 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPI
# Enable -Wstring-conversion to catch misuse of string literals.
add_flag_if_supported("-Wstring-conversion" STRING_CONVERSION_FLAG)
+ # Enable -Wstrict-prototypes to catch incorrectly declared functions in C.
+ add_flag_if_supported("-Wstrict-prototypes" STRICT_PROTOTYPES_FLAG)
endif (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT LLVM_ENABLE_WARNINGS)
More information about the llvm-commits
mailing list