From 6e45046f31209ef92a5a9cc9cb9790f7bd68ea1d Mon Sep 17 00:00:00 2001 From: Bhagirath Mehta Date: Thu, 11 Jun 2026 00:47:44 -0500 Subject: [PATCH 1/3] Build native desktop SDK in MSVC conformance mode (/permissive-) Enable ConformanceMode (/permissive-) for the native desktop SDK projects via the shared Solutions/build.props, so non-standard MSVC extensions are caught at build time (issue #255). Two project families are deliberately excluded, gated in the ItemDefinitionGroup condition: * UWP / Windows Store projects (AppContainerApplication=true) compile as C++/CX (/ZW), which MSVC rejects in combination with /permissive-. * C++/CLI managed projects (Keyword=ManagedCProj, e.g. net40) target the managed runtime and are a separate conformance domain. build.props is imported only by the SDK projects (net40, win10-*, win32-*), not by vendored sqlite/zlib or the test projects, so vendored third-party code is unaffected. Validated locally (VS 2026, v145, x64 Release): clean Rebuild of win32-lib (58 files) plus win32-dll / win32-mini-lib / win32-mini-dll all compile with 0 conformance errors and 0 warnings. Confirmed the gate excludes UWP (win10-lib does not receive /permissive-, so its /ZW build is unaffected). Files: Solutions/build.props Resolves #255. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Solutions/build.props | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Solutions/build.props b/Solutions/build.props index 27e3266ba..cd092abf5 100644 --- a/Solutions/build.props +++ b/Solutions/build.props @@ -13,4 +13,19 @@ $(OutDir)$(TargetName)$(TargetExt) + + + + true + + From 284c9a4ca448fba5b7cdad9f1a14cb82782eaa88 Mon Sep 17 00:00:00 2001 From: Bhagirath Mehta Date: Thu, 11 Jun 2026 01:21:01 -0500 Subject: [PATCH 2/3] Extend conformance mode to net40 (C++/CLI) and fix /permissive- errors Bring the net40 managed (C++/CLI) project under /permissive- by dropping the Keyword=ManagedCProj exclusion from the build.props gate, and fix the two conformance errors this surfaced in shared CX code: * lib/shared/EventPropertiesCX.cpp: add `typename` to the dependent name `map::iterator` in StoreEventProperties (C3878/C2065 under two-phase name lookup). * lib/shared/PlatformHelpers.h: forward-declare FromPlatformString before the FromPlatformMap templates that call it. Under strict two-phase lookup the dependent call fell back to ADL (which searches Platform::, not the SDK namespace) and failed with C3861. Now only UWP / Windows Store (C++/CX, /ZW) projects are excluded, since /permissive- is incompatible with /ZW. Validated (VS 2026, v145, x64 Release): clean Rebuild of the full non-UWP SDK set -- win32-lib, win32-dll, win32-mini-lib, win32-mini-dll and net40 -- with 0 conformance errors. (net40 is .NET Framework 4.0 C++/CLI; local builds need the v4.0 reference-assembly targeting pack, which the SDK CI provides.) Files: Solutions/build.props, lib/shared/EventPropertiesCX.cpp, lib/shared/PlatformHelpers.h Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Solutions/build.props | 13 +++++-------- lib/shared/EventPropertiesCX.cpp | 2 +- lib/shared/PlatformHelpers.h | 5 +++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Solutions/build.props b/Solutions/build.props index cd092abf5..fe1bcdcd4 100644 --- a/Solutions/build.props +++ b/Solutions/build.props @@ -14,16 +14,13 @@ - + true diff --git a/lib/shared/EventPropertiesCX.cpp b/lib/shared/EventPropertiesCX.cpp index 9c212d919..889965f6d 100644 --- a/lib/shared/EventPropertiesCX.cpp +++ b/lib/shared/EventPropertiesCX.cpp @@ -26,7 +26,7 @@ namespace Microsoft { FromPlatformMap(propertiesMap, properties); FromPlatformMap(this->PIITags, piiTags); - for (map::iterator it = properties.begin(); it != properties.end(); ++it) + for (typename map::iterator it = properties.begin(); it != properties.end(); ++it) { MAT::PiiKind piiType = MAT::PiiKind_None; auto tag = piiTags.find(it->first); diff --git a/lib/shared/PlatformHelpers.h b/lib/shared/PlatformHelpers.h index 47d1e723d..222ee0024 100644 --- a/lib/shared/PlatformHelpers.h +++ b/lib/shared/PlatformHelpers.h @@ -105,6 +105,11 @@ namespace Microsoft { void ThrowPlatformInvalidArgumentException(String^ message); void ThrowPlatformException(String^ message); + // Forward declaration so the FromPlatformMap templates below can + // resolve this helper under /permissive- two-phase name lookup + // (the definition appears later in this header). + std::string FromPlatformString(String^ platformString); + // Defining the template function in the header file eliminates the need in additional linker definitions. // platformmaptype can be read-only or editable platform map. template class platformmaptype> From 1afe1efd9492a5badfeeb9947301b44ec4b6eb7c Mon Sep 17 00:00:00 2001 From: Bhagirath Mehta Date: Thu, 11 Jun 2026 03:26:33 -0500 Subject: [PATCH 3/3] =?UTF-8?q?build:=20address=20Copilot=20round-1=20?= =?UTF-8?q?=E2=80=94=20scope=20/permissive-=20to=20SDK=20library=20project?= =?UTF-8?q?s=20only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Solutions/build.props (Copilot): the ConformanceMode block lived on the shared build.props, which is ALSO imported by vendored sqlite/zlib, the test projects (gtest/gmock/UnitTests/FuncTests) and the samples -- so /permissive- was applied far more broadly than intended, and the PR description's claim was wrong. Verified with `git grep -l build.props -- '*.vcxproj'`: sqlite/sqlite.vcxproj, third_party/.../zlibvc.vcxproj and tests/{functests,unittests}/*.vcxproj all import it. Fix: move ConformanceMode into a dedicated Solutions/conformance.props, imported explicitly only by the five native SDK library projects (win32-lib, win32-dll, win32-mini-lib, win32-mini-dll, net40), right after their build.props import so the setting wins. build.props is reverted to its original content. Validated (VS 2026, v145, x64 Release): /permissive- present on win32-lib's cl invocations (0 conformance errors); a standalone sqlite:Rebuild now shows 0 /permissive- occurrences; clean Rebuild of all five SDK library projects. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Solutions/build.props | 12 ---------- Solutions/conformance.props | 23 +++++++++++++++++++ Solutions/net40/net40.vcxproj | 1 + Solutions/win32-dll/win32-dll.vcxproj | 1 + Solutions/win32-lib/win32-lib.vcxproj | 1 + .../win32-mini-dll/win32-mini-dll.vcxproj | 1 + .../win32-mini-lib/win32-mini-lib.vcxproj | 1 + 7 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 Solutions/conformance.props diff --git a/Solutions/build.props b/Solutions/build.props index fe1bcdcd4..27e3266ba 100644 --- a/Solutions/build.props +++ b/Solutions/build.props @@ -13,16 +13,4 @@ $(OutDir)$(TargetName)$(TargetExt) - - - - true - - diff --git a/Solutions/conformance.props b/Solutions/conformance.props new file mode 100644 index 000000000..79e1ae779 --- /dev/null +++ b/Solutions/conformance.props @@ -0,0 +1,23 @@ + + + + + true + + + diff --git a/Solutions/net40/net40.vcxproj b/Solutions/net40/net40.vcxproj index ec55747a0..d21aede17 100644 --- a/Solutions/net40/net40.vcxproj +++ b/Solutions/net40/net40.vcxproj @@ -290,6 +290,7 @@ + diff --git a/Solutions/win32-dll/win32-dll.vcxproj b/Solutions/win32-dll/win32-dll.vcxproj index 026356130..b01b9e690 100644 --- a/Solutions/win32-dll/win32-dll.vcxproj +++ b/Solutions/win32-dll/win32-dll.vcxproj @@ -337,6 +337,7 @@ + diff --git a/Solutions/win32-lib/win32-lib.vcxproj b/Solutions/win32-lib/win32-lib.vcxproj index 90602e232..1b9fb6a7c 100644 --- a/Solutions/win32-lib/win32-lib.vcxproj +++ b/Solutions/win32-lib/win32-lib.vcxproj @@ -537,6 +537,7 @@ + diff --git a/Solutions/win32-mini-dll/win32-mini-dll.vcxproj b/Solutions/win32-mini-dll/win32-mini-dll.vcxproj index ce42cf020..fe923aee2 100644 --- a/Solutions/win32-mini-dll/win32-mini-dll.vcxproj +++ b/Solutions/win32-mini-dll/win32-mini-dll.vcxproj @@ -390,6 +390,7 @@ + diff --git a/Solutions/win32-mini-lib/win32-mini-lib.vcxproj b/Solutions/win32-mini-lib/win32-mini-lib.vcxproj index e720328fd..700623d89 100644 --- a/Solutions/win32-mini-lib/win32-mini-lib.vcxproj +++ b/Solutions/win32-mini-lib/win32-mini-lib.vcxproj @@ -678,6 +678,7 @@ +