oneapi-src / oneDPL

oneAPI DPC++ Library (oneDPL) https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/dpc-library.html
Apache License 2.0
715 stars 112 forks source link

Addressing static analysis errors #1640

Closed timmiesmith closed 2 weeks ago

timmiesmith commented 2 weeks ago

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.

timmiesmith commented 2 weeks ago

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?

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.

timmiesmith commented 2 weeks ago

CI issues have been resolved.