Skip to content

Commit ffdfecc

Browse files
committed
Try to tweak some things so that warnings are detected and break the build
1 parent a23bd54 commit ffdfecc

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

cppwinrt.sln

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress_test", "test\stress_
136136
ProjectSection(ProjectDependencies) = postProject
137137
{A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270} = {A91B8BF3-28E4-4D9E-8DBA-64B70E4F0270}
138138
{D613FB39-5035-4043-91E2-BAB323908AF4} = {D613FB39-5035-4043-91E2-BAB323908AF4}
139-
{F1C915B3-2C64-4992-AFB7-7F035B1A7607} = {F1C915B3-2C64-4992-AFB7-7F035B1A7607}
140139
EndProjectSection
141140
EndProject
142141
Global

strings/base_macros.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
#ifdef _MSC_VER
1919
// Note: this is a workaround for a false-positive warning produced by the Visual C++ 15.9 compiler.
20-
#pragma warning(disable : 5046)
20+
//#pragma warning(disable : 5046)
2121

2222
// Note: this is a workaround for a false-positive warning produced by the Visual C++ 16.3 compiler.
23-
#pragma warning(disable : 4268)
23+
//#pragma warning(disable : 4268)
2424
#endif
2525

2626
#if defined(__cpp_lib_coroutine) || defined(__cpp_coroutines) || defined(_RESUMABLE_FUNCTIONS_SUPPORTED)

test/stress_test/GeneratePrecompiledHeader.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ foreach ($header in $allHeaders)
2020
{
2121
$chunks = $header.FullName.Split("\\");
2222
$header = $chunks[$chunks.Length - 1];
23-
$generatedPchContent += "#include <winrt/$header>`r`n";
23+
$generatedPchContent += "#include `"winrt/$header`"`r`n";
2424
}
2525

2626
Set-Content -Path "$generatedFilesDir\\pch.h" -Value $generatedPchContent -Force -Encoding UTF8

test/stress_test/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@ using namespace winrt;
44

55
int main()
66
{
7+
init_apartment();
8+
9+
winrt::Windows::Foundation::Uri uri{ L"https://www.microsoft.com" };
10+
const auto asString = uri.ToString();
11+
12+
return 0;
713
}

test/stress_test/stress_test.vcxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
<!-- Not using the real nuget package so override-->
4040
<CppWinRTPackageDir>..\_build\$(Platform)\$(Configuration)</CppWinRTPackageDir>
4141
<CppWinRTPackage>false</CppWinRTPackage>
42+
<!-- Null out CAExcludePath so that the include files are not automatically excluded from analysis. -->
43+
<!-- <CAExcludePath></CAExcludePath> -->
44+
<!-- <RunCodeAnalysis>true</RunCodeAnalysis> -->
4245
</PropertyGroup>
4346
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
4447
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
@@ -53,6 +56,9 @@
5356
<ClCompile>
5457
<AdditionalIncludeDirectories>$(OutputPath);Generated Files;..;..\..\cppwinrt</AdditionalIncludeDirectories>
5558
<TreatWarningAsError>true</TreatWarningAsError>
59+
<!-- <ExternalWarningLevel>Level4</ExternalWarningLevel> -->
60+
<!-- <ExternalTemplatesDiagnostics>true</ExternalTemplatesDiagnostics> -->
61+
<!-- <AnalyzeExternalRuleset>NativeRecommendedRules.ruleset</AnalyzeExternalRuleset> -->
5662
</ClCompile>
5763
<Link>
5864
<SubSystem>Console</SubSystem>

0 commit comments

Comments
 (0)