-
Notifications
You must be signed in to change notification settings - Fork 115
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
Addressing static analysis errors #1640
Conversation
…tatic code analysis errors.
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
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
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.
Looks good, but I'm curious what were the errors from the static analysis tool? If the user-defined copy constructor is identical to the default copy constructor, what is the error? Or is the error that it the user-defined copy constructor is unnecessary?
… algorithms that may throw exceptions.
ae4745d
@@ -104,7 +104,7 @@ __for_each_n_it_serial(_ForwardIterator __first, _Size __n, _Function __f) | |||
//------------------------------------------------------------------------ | |||
template <class _ForwardIterator, class _Function> | |||
void | |||
__brick_walk1(_ForwardIterator __first, _ForwardIterator __last, _Function __f, /*vector=*/::std::false_type) noexcept |
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.
From the CI, it looks like there is a forward declaration you also need to change.
Static analysis identified it as a violation of the Rule of Three, basically seeing the user-defined copy constructor and expecting to see corresponding user-defined assignment operator and destructor. |
CI issues have been resolved. |
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
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
Scanning oneDPL code with a static analysis tool identified the two versions of a complex comparator in the SIMD unseq backend. This PR removes the user-defined copy constructors since they are explicit versions of the default copy constructor to address the errors from the static analysis tool.
In addition the scans also identified two functions used in the implementation of uninitialized memory algorithms that were tagged with the noexcept keyword. In the case of the uninitialized memory functors new may be called, in which case an exception could be thrown.