[Mlir-commits] [mlir] bf14685 - [mlir] Change deprecated -Werror-implicit-function-declaration to -Werror=implicit-function-declaration

Fangrui Song llvmlistbot at llvm.org
Wed Nov 4 18:33:58 PST 2020


Author: Fangrui Song
Date: 2020-11-04T18:33:51-08:00
New Revision: bf146857bbb3fa4bc30ee4f42829ddc4c19c41de

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

LOG: [mlir] Change deprecated -Werror-implicit-function-declaration to -Werror=implicit-function-declaration

This -Werror- form has been deprecated since 2007 (GCC r122017).

And only enable it for CMAKE_C_FLAGS. C++ does not need it.

Added: 
    

Modified: 
    mlir/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 90cb422f54a1..0954eeae0763 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -12,7 +12,8 @@ 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)
+check_c_compiler_flag("-Werror=implicit-function-declaration" C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION)
+append_if(C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION "-Werror=implicit-function-declaration" CMAKE_C_FLAGS)
 
 # Installing the headers and docs needs to depend on generating any public
 # tablegen'd targets.


        


More information about the Mlir-commits mailing list