[PATCH] D98224: [cmake] Enable -Werror=return-type

Dave Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 9 13:51:41 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGce94a161651d: [cmake] Enable -Werror=return-type (authored by kastiglione).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98224/new/

https://reviews.llvm.org/D98224

Files:
  llvm/cmake/modules/HandleLLVMOptions.cmake


Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -745,6 +745,10 @@
 
   # Enable -Wstring-conversion to catch misuse of string literals.
   add_flag_if_supported("-Wstring-conversion" STRING_CONVERSION_FLAG)
+
+  # Enable -Werror=return-type if available, to catch functions that contain
+  # control paths that do not return a value.
+  add_flag_if_supported("-Werror=return-type" WERROR_RETURN_TYPE)
 endif (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
 
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT LLVM_ENABLE_WARNINGS)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98224.329460.patch
Type: text/x-patch
Size: 717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210309/94f79de1/attachment.bin>


More information about the llvm-commits mailing list