summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-08-31 13:23:24 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-08-31 13:23:24 +0000
commitfbac1ae0622f17aaa3ee15a1bd7b6d8a64be9358 (patch)
tree89047c66d3a11de60f42d59d3362e72f20e13967 /llvm
parent56572c6a5e47eb8581662f436810e2472416e91f (diff)
downloadbcm5719-llvm-fbac1ae0622f17aaa3ee15a1bd7b6d8a64be9358.tar.gz
bcm5719-llvm-fbac1ae0622f17aaa3ee15a1bd7b6d8a64be9358.zip
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 llvm-svn: 312240
Diffstat (limited to 'llvm')
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 86806140023..a293dde1499 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -581,6 +581,8 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
# 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)
OpenPOWER on IntegriCloud