From fa8fe4a6fd59794b863b0bea4961f092c5d6b00e Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Mon, 22 Jul 2024 10:13:16 -0400 Subject: [PATCH 1/4] Add `/W4` to Windows CI builds This should help catch a wider variety of warnings. --- .github/workflows/single-file-build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/single-file-build-and-test.yml b/.github/workflows/single-file-build-and-test.yml index b1ed9270..3c589210 100644 --- a/.github/workflows/single-file-build-and-test.yml +++ b/.github/workflows/single-file-build-and-test.yml @@ -43,5 +43,5 @@ jobs: - name: Build and run test shell: cmd run: | - cl.exe /std:c++14 single-file-test.cc + cl.exe /std:c++14 /W4 single-file-test.cc single-file-test.exe From 38271e62aada8a876c831c53de010b7b6ac29ea5 Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Mon, 22 Jul 2024 10:50:11 -0400 Subject: [PATCH 2/4] Also add `/WX` to treat warnings as errors --- .github/workflows/single-file-build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/single-file-build-and-test.yml b/.github/workflows/single-file-build-and-test.yml index 3c589210..7b9ae09d 100644 --- a/.github/workflows/single-file-build-and-test.yml +++ b/.github/workflows/single-file-build-and-test.yml @@ -43,5 +43,5 @@ jobs: - name: Build and run test shell: cmd run: | - cl.exe /std:c++14 /W4 single-file-test.cc + cl.exe /std:c++14 /W4 /WX single-file-test.cc single-file-test.exe From b18b9a8feb73d1a407ea84219ee97ff7e9fd03ed Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Wed, 24 Jul 2024 14:36:31 -0400 Subject: [PATCH 3/4] Try fixing error --- .github/workflows/single-file-build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/single-file-build-and-test.yml b/.github/workflows/single-file-build-and-test.yml index 7b9ae09d..0c258bb6 100644 --- a/.github/workflows/single-file-build-and-test.yml +++ b/.github/workflows/single-file-build-and-test.yml @@ -43,5 +43,5 @@ jobs: - name: Build and run test shell: cmd run: | - cl.exe /std:c++14 /W4 /WX single-file-test.cc + cl.exe /std:c++14 /W4 /WX /EHsc single-file-test.cc single-file-test.exe From 3d910ebc44fbc629580bb6dd93c8a6b2b039b1e2 Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Wed, 24 Jul 2024 14:38:29 -0400 Subject: [PATCH 4/4] Stop naming unused variables --- single-file-test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/single-file-test.cc b/single-file-test.cc index 62e8bd99..16f0e0cc 100644 --- a/single-file-test.cc +++ b/single-file-test.cc @@ -38,7 +38,7 @@ bool expect_equal(ExpectedT expected, ActualT actual) { return true; } -int main(int argc, char **argv) { +int main(int, char **) { const std::vector results{ { expect_equal((meters / second)(5) * seconds(6), meters(30)),