From f3c6fd540f355e7ec8ec07eb660514f5b31fede8 Mon Sep 17 00:00:00 2001 From: "Yang, Hao Xiang" Date: Wed, 7 Dec 2022 06:38:53 -0800 Subject: [PATCH] Fixed coverity issue in acl_context.cpp: Type: AUTO_CAUSES_COPY (AUTO_CAUSES_COPY) Changed to `const cl_context _context` since coverity complains about the previous code auto _context would make an auto copy of the pointer contexts in acl_platform.contexts_set. Because `_context` is a pointer, a copy is equally as cheap as a reference, and to pass coverity which only mentions `auto` copy. --- src/acl_context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/acl_context.cpp b/src/acl_context.cpp index 63c59cf7..e9fb97bb 100644 --- a/src/acl_context.cpp +++ b/src/acl_context.cpp @@ -1202,7 +1202,7 @@ void acl_idle_update(cl_context context) { // firstly update the current context acl_update_context(context); // update the other contexts from the platform - for (auto _context : acl_platform.contexts_set) { + for (const cl_context _context : acl_platform.contexts_set) { if (context != _context) acl_update_context(_context); }