[libcxx-commits] [libcxx] [libcxx] Do not define _CRT_STDIO_ISO_WIDE_SPECIFIERS on Windows (PR #238233)

Petr Hosek via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 2 23:05:59 PST 2026


https://github.com/petrhosek created https://github.com/llvm/llvm-project/pull/238233

Most C++ projects on Windows (including LLVM) do not define
_CRT_STDIO_ISO_WIDE_SPECIFIERS, which causes linker mismatches when
linking against a static libc++ built with that macro defined.


>From 4ad3157be2083b5beae2aeff6ff3352a9d6bcb43 Mon Sep 17 00:00:00 2001
From: Petr Hosek <phosek at google.com>
Date: Sat, 31 Oct 2026 17:48:55 -0700
Subject: [PATCH] [libcxx] Do not define _CRT_STDIO_ISO_WIDE_SPECIFIERS on
 Windows

Most C++ projects on Windows (including LLVM) do not define
_CRT_STDIO_ISO_WIDE_SPECIFIERS, which causes linker mismatches when
linking against a static libc++ built with that macro defined.
---
 libcxx/CMakeLists.txt | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 8841f5d07aaf6c..16002678ba7d53 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -727,10 +727,7 @@ function(cxx_add_windows_flags target)
                                  # Don't warn on the use of "deprecated"
                                  # "insecure" functions which are standards
                                  # specified.
-                                 _CRT_SECURE_NO_WARNINGS
-                                 # Use the ISO conforming behaviour for conversion
-                                 # in printf, scanf.
-                                 _CRT_STDIO_ISO_WIDE_SPECIFIERS)
+                                 _CRT_SECURE_NO_WARNINGS)
   endif()
 endfunction()
 



More information about the libcxx-commits mailing list