-
Notifications
You must be signed in to change notification settings - Fork 461
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
fix compilation for Visual Studio 2022 #1492
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1492 +/- ##
=======================================
Coverage 64.71% 64.71%
=======================================
Files 3 3
Lines 1981 1981
Branches 687 687
=======================================
Hits 1282 1282
Misses 138 138
Partials 561 561 ☔ View full report in Codecov by Sentry. |
@vmoroz thanks for the investigation and the PR. One question about the I'd have to look closer but adding noexcept I think means it would be breaking to remove those. I understand that if we did make them throw exceptions we'd have to change some other methods to catch those, but the way adding them now would change that to a breaking versus non-breaking change so we should make sure we believe that for those with the additions we believe it would never make sense for them to through an exception. Otherwise we should possibly add a try catch around the calls versus adding the noexcept. |
@mhdawson , it were the recommendations from Visual Studio. The move constructors and assignment operators are typically must be noexcept. In other cases VS saw that methods never through and suggested to make them noexcept. |
@vmoroz I'd say lets keep this PR to just what is needed to fix the compile failures, and then we can look more closely at the good to haves :) |
@mhdawson , I have removed all newly added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@vmoroz many thanks. I'm going to go ahead an land this so that we can get the cross platform CI testing green again. |
Fix PR fixes compilation errors and warnings while compiling code in VS 2022.
std::allocator
APIs. Their use is is replaced with APIs that is still valid.ObjectWrap<T>::WrappedMethod
. It was saying that&
operation requires an l-value. The issue is fixed by copyingmethod
pointer to a local variable before invocation.{}
.noexcept
. They are augmented withNAPI_NOEXCEPT
.BEGIN_COMMIT_OVERRIDE
fix: fix compilation for Visual Studio 2022 (#1492)
END_COMMIT_OVERRIDE