Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable more test coverage for warning C4668 ('MEOW' is not defined as a preprocessor macro) #4441

Merged
merged 6 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions stl/inc/climits
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR

#pragma warning(push) // TRANSITION, VSO-1985428
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <limits.h>
#pragma warning(pop)

#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CLIMITS_
3 changes: 3 additions & 0 deletions tests/std/include/test_death.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
#include <string>
#include <vector>

#pragma warning(push) // TRANSITION, OS-23694920
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <Windows.h>
#pragma warning(pop)

namespace std_testing {
constexpr int internal_failure = 103;
Expand Down
3 changes: 3 additions & 0 deletions tests/std/include/test_thread_support.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
#include <mutex>
#include <thread>

#pragma warning(push) // TRANSITION, OS-23694920
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <Windows.h>
#pragma warning(pop)

class one_shot {
bool unblock = false;
Expand Down
3 changes: 3 additions & 0 deletions tests/std/tests/Dev08_563686_ostream/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
#include <cstdlib>
#include <sstream>

#pragma warning(push) // TRANSITION, OS-23694920
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <Windows.h>
#pragma warning(pop)

int main() {
// Track CRT blocks
Expand Down
3 changes: 3 additions & 0 deletions tests/std/tests/Dev09_056375_locale_cleanup/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
#include <cstdio>
#include <locale>

#pragma warning(push) // TRANSITION, OS-23694920
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <Windows.h>
#pragma warning(pop)

using namespace std;

Expand Down
3 changes: 0 additions & 3 deletions tests/std/tests/Dev09_056375_locale_cleanup/testdll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

#include <cassert>
#include <locale>

#include <Windows.h>

using namespace std;

// Tests for DLL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ InvalidFunctor make_error_condition{};
#include <future>
#endif // _M_CEE_PURE

#pragma warning(push) // TRANSITION, OS-23694920
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <Windows.h>
#pragma warning(pop)

using namespace std;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
#include <isa_availability.h>
#include <ranges>

#pragma warning(push) // TRANSITION, OS-23694920
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <Windows.h>
#pragma warning(pop)

using namespace std;

Expand Down
3 changes: 3 additions & 0 deletions tests/std/tests/P2093R14_formatted_output/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
#include <string_view>
#include <vector>

#pragma warning(push) // TRANSITION, OS-23694920
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <Windows.h>
#pragma warning(pop)

#include "temp_file_name.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
#include <exception>
#include <excpt.h>

#pragma warning(push) // TRANSITION, OS-23694920
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <Windows.h>
#pragma warning(pop)

ULONG_PTR data[] = {0xC0FFEE, 1729};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
#include <exception>
#include <excpt.h>

#pragma warning(push) // TRANSITION, OS-23694920
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <Windows.h>
#pragma warning(pop)

ULONG_PTR data[] = {0xC0FFEE, 1729};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
#include <string>
#include <system_error>

#pragma warning(push) // TRANSITION, OS-23694920
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <Windows.h>
#pragma warning(pop)

using namespace std;
namespace fs = std::experimental::filesystem;
Expand Down
3 changes: 3 additions & 0 deletions tests/std/tests/VSO_0226079_mutex/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
#include <thread>
#include <utility>

#pragma warning(push) // TRANSITION, OS-23694920
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <Windows.h>
#pragma warning(pop)

using namespace std;
using namespace std::chrono;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
#include <cassert>
#include <cstdio>

#pragma warning(push) // TRANSITION, OS-23694920
#pragma warning(disable : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#include <Windows.h>
#pragma warning(pop)

int main() {
// A customer wanted to read a std::atomic from a read-only memory-mapped file.
Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/prefix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

RUNALL_INCLUDE ..\..\universal_prefix.lst
RUNALL_CROSSLIST
* PM_CL="/FIforce_include.hpp /w14365 /w15267 /D_ENFORCE_FACET_SPECIALIZATIONS=1 /D_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER"
* PM_CL="/FIforce_include.hpp /w14365 /w14668 /w15267 /D_ENFORCE_FACET_SPECIALIZATIONS=1 /D_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER"
5 changes: 1 addition & 4 deletions tests/tr1/include/tdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ int ulp = EPS_ULPL;
#endif // value of FLOAT_TYPE

int approx2(Float_type d1, Float_type d2, Float_type sensitivity) { // test for approximate equality
#if 199901L <= __STDC_VERSION__
if (isunordered(d1, d2)) { // at least one NaN
if (!terse) { // report NaNs
if (isnan(d1)) {
Expand All @@ -381,9 +380,7 @@ int approx2(Float_type d1, Float_type d2, Float_type sensitivity) { // test for
}
}
return 0;
} else
#endif // 199901L <= __STDC_VERSION__
{ // compare finite values
} else { // compare finite values
Float_type err;

if (d2 != (Float_type) 0) {
Expand Down
2 changes: 1 addition & 1 deletion tests/tr1/prefix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

RUNALL_INCLUDE ..\universal_prefix.lst
RUNALL_CROSSLIST
* PM_CL="/FIforce_include.hpp /w15267 /D_ENFORCE_FACET_SPECIALIZATIONS=1 /D_CRT_SECURE_NO_WARNINGS /D_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER"
* PM_CL="/FIforce_include.hpp /w14668 /w15267 /D_ENFORCE_FACET_SPECIALIZATIONS=1 /D_CRT_SECURE_NO_WARNINGS /D_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER"
12 changes: 6 additions & 6 deletions tests/tr1/tests/regex2/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,12 @@ static const regex_test tests[] = {

{__LINE__, T("\\x1b"), T("\x1b"), "1 0 1", ECMA},

#if WIDE
#ifdef WIDE
{__LINE__, T("\\u12cd"), T("\u12cd"), "1 0 1", ECMA},
{__LINE__, T("\\u12cd"), T(""), "-1", NOT_ECMA},
#else
#else // defined WIDE
{__LINE__, T("\\u12cd"), T(""), "-1", ALL},
#endif
#endif // defined WIDE

{__LINE__, T("\\07"), T("\07"), "1 0 1", AWK},
{__LINE__, T("\\177"), T("\177"), "1 0 1", AWK},
Expand Down Expand Up @@ -495,11 +495,11 @@ static const regex_test tests[] = {
{__LINE__, T("[\\x1b]"), T("x"), "1 0 1", NOT_ECMA},
{__LINE__, T("[\\x1b]"), T("1"), "1 0 1", NOT_ECMA},
{__LINE__, T("[\\x1b]"), T("b"), "1 0 1", NOT_ECMA},
#if WIDE
#ifdef WIDE
{__LINE__, T("[\\u12cd]"), T("\u12cd"), "1 0 1", ECMA},
#else
#else // defined WIDE
{__LINE__, T("[\\u12cd]"), T(""), "-1", ECMA},
#endif
#endif // defined WIDE
{__LINE__, T("[\\u12cd]"), T("\\"), "1 0 1", NOT_ECMA},
{__LINE__, T("[\\u12cd]"), T("u"), "1 0 1", NOT_ECMA},
{__LINE__, T("[\\u12cd]"), T("1"), "1 0 1", NOT_ECMA},
Expand Down