[PATCH] D125263: [CMake][MSVC] Compile with `/permissive-`
مهدي شينون (Mehdi Chinoune) via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 20 09:20:46 PDT 2022
MehdiChinoune updated this revision to Diff 438428.
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.438428.patch
Type: text/x-patch
Size: 1350 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220620/dd8f67e2/attachment.bin>
More information about the llvm-commits
mailing list