Skip to content

Treat MSVC warnings as errors#2930

Merged
nlohmann merged 5 commits into
developfrom
msvc_warnings_as_error
Aug 13, 2021
Merged

Treat MSVC warnings as errors#2930
nlohmann merged 5 commits into
developfrom
msvc_warnings_as_error

Conversation

@nlohmann
Copy link
Copy Markdown
Owner

This PR is a follow up to #2924 and treats all MSVC warnings as errors.

@nlohmann nlohmann self-assigned this Aug 13, 2021
@nlohmann nlohmann marked this pull request as draft August 13, 2021 10:47
@nlohmann nlohmann mentioned this pull request Aug 13, 2021
@coveralls
Copy link
Copy Markdown

coveralls commented Aug 13, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling 4b0e04e on msvc_warnings_as_error into 910fabf on develop.

@nlohmann nlohmann marked this pull request as ready for review August 13, 2021 12:37
@nlohmann nlohmann added this to the Release 3.9.2 milestone Aug 13, 2021
Comment thread test/src/unit-allocator.cpp Outdated
std::allocator<T>::deallocate(p, n);
}

// the code below warns about p in MSVC 2015 - this could be a bug
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"C4100 can also be issued when code calls a destructor on a otherwise unreferenced parameter of primitive type. This is a limitation of the Microsoft C++ compiler."
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4100?view=msvc-160

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I fixed it.

Comment thread test/src/unit-udt.cpp Outdated
}

// the code below warns about t in MSVC 2015 - this could be a bug
DOCTEST_MSVC_SUPPRESS_WARNING_PUSH
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same class of error as the other one, sizeof(t) is a compile-time constant based only on T, not on the value of t.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I also fixed it.

@nlohmann nlohmann merged commit 6ac037c into develop Aug 13, 2021
@nlohmann nlohmann deleted the msvc_warnings_as_error branch August 13, 2021 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants