[PATCH] D125263: [CMake][MSVC] Compile with `/permissive-`

مهدي شينون (Mehdi Chinoune) via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 14:31:10 PDT 2022


MehdiChinoune updated this revision to Diff 437339.
MehdiChinoune added a comment.

Apply suggestions from reviewer


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

https://reviews.llvm.org/D125263

Files:
  llvm/cmake/modules/HandleLLVMOptions.cmake


Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -522,17 +522,9 @@
     endif()
   endif()
 
-  # Disable string literal const->non-const type conversion.
-  # "When specified, the compiler requires strict const-qualification
-  # conformance for pointers initialized by using string literals."
-  append("/Zc:strictStrings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-
   # "Generate Intrinsic Functions".
   append("/Oi" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 
-  # "Enforce type conversion rules".
-  append("/Zc:rvalueCast" CMAKE_CXX_FLAGS)
-
   if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT LLVM_ENABLE_LTO)
     # clang-cl and cl by default produce non-deterministic binaries because
     # link.exe /incremental requires a timestamp in the .obj file.  clang-cl
@@ -561,6 +553,10 @@
   # but in many objects files need more than that. This flag is to increase the
   # number of sections.
   append("/bigobj" CMAKE_CXX_FLAGS)
+
+  # Enable standards conformance mode.
+  # This ensures handling of various C/C++ constructs is more similar to other compilers.
+  append("/permissive-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 endif( MSVC )
 
 # Warnings-as-errors handling for GCC-compatible compilers:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125263.437339.patch
Type: text/x-patch
Size: 1350 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220615/dde18b16/attachment.bin>


More information about the llvm-commits mailing list