Enable more test coverage for warning C4668 ('MEOW' is not defined as a preprocessor macro) #4441
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Warning C4668 is off-by-default, but quite useful because (1) we conventionally never want to rely on the Standard's behavior of expanding not-defined macros to
0
, and (2) it can detect typos. We already have some test coverage for it:STL/stl/inc/__msvc_all_public_headers.hpp
Line 13 in 8b081e2
However, we haven't applied this warning to our entire test suite, so I've had to catch other PRs unintentionally expanding not-defined macros.
std
andtr1
, enable warning C4668'MEOW'
is not defined as a preprocessor macro, replacing with'0'
for'#if/#elif'
.libcxx
because it doesn't follow our convention.<Windows.h>
._WIN32_WINNT_*
version macros (which may subtly break code)".<Windows.h>
.#if WIDE
=>#ifdef WIDE
tr1/include/tdefs.h
.'__STDC_VERSION__'
is not defined as a preprocessor macro, replacing with'0'
for'#if/#elif'
".tr1
, but this looks like a straightforward improvement, and it only takes effect when the "approximately equal" test is already going to fail.<limits.h>
.<limits.h>
emits warning C4668:'__STDC_WANT_SECURE_LIB__'
is not defined as a preprocessor macro, replacing with'0'
for'#if/#elif'
".