• Matthias Gehre's avatar
    modules/core/src/ocl.cpp: Fix dangling pointer · 0e92ac2a
    Matthias Gehre authored
    Detected by clang trunk:
    ```
    opencv/modules/core/src/ocl.cpp:4337:37: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling]
            CV_OCL_CHECK_RESULT(retval, cv::format("clCreateBuffer(capacity=%lld) => %p", (long long int)entry.capacity_, (void*)entry.clBuffer_).c_str());
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    opencv/modules/core/src/ocl.cpp:193:42: note: expanded from macro 'CV_OCL_CHECK_RESULT'
                if (0) { const char* msg_ = (msg); CV_UNUSED(msg_); /* ensure const char* type (cv::String without c_str()) */ } \
    ```
    because `cv::format` yields a temporary std::string, and thus `msg_` points to a destroyed buffer.
    0e92ac2a
Name
Last commit
Last update
..
calib3d Loading commit data...
core Loading commit data...
dnn Loading commit data...
features2d Loading commit data...
flann Loading commit data...
gapi Loading commit data...
highgui Loading commit data...
imgcodecs Loading commit data...
imgproc Loading commit data...
java Loading commit data...
js Loading commit data...
ml Loading commit data...
objdetect Loading commit data...
photo Loading commit data...
python Loading commit data...
stitching Loading commit data...
ts Loading commit data...
video Loading commit data...
videoio Loading commit data...
world Loading commit data...
CMakeLists.txt Loading commit data...