[Mlir-commits] [mlir] 065047a - Enable -Werror-implicit-function-declaration by default (NFC)

Mehdi Amini llvmlistbot at llvm.org
Tue Nov 3 22:37:14 PST 2020


Author: Mehdi Amini
Date: 2020-11-04T06:36:32Z
New Revision: 065047ab01b30ead4c7b618e57266482fb61d901

URL: https://github.com/llvm/llvm-project/commit/065047ab01b30ead4c7b618e57266482fb61d901
DIFF: https://github.com/llvm/llvm-project/commit/065047ab01b30ead4c7b618e57266482fb61d901.diff

LOG: Enable -Werror-implicit-function-declaration by default (NFC)

This is useful in C source files where it is easy for a typo to be
silently assumed by the compiler to be an implicit declaration.

Differential Revision: https://reviews.llvm.org/D90727

Added: 
    

Modified: 
    mlir/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 7c26cc9f4b95..90cb422f54a1 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -10,6 +10,10 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
 
 include(AddMLIR)
 
+# Forbid implicit function declaration: this may lead to subtle bugs and we
+# don't have a reason to support this.
+add_flag_if_supported("-Werror-implicit-function-declaration" WERROR_IMPLICIT_FUNCTION_DECLARATION)
+
 # Installing the headers and docs needs to depend on generating any public
 # tablegen'd targets.
 # mlir-generic-headers are dialect-independent.


        


More information about the Mlir-commits mailing list