diff --git a/src/c_wrapper/error.h b/src/c_wrapper/error.h index f7dc72b2419ac2b8c234e4526fcccbe480f0e41f..1bf4ab9fdad5be31028eb20d91fd2f311fbe6f6f 100644 --- a/src/c_wrapper/error.h +++ b/src/c_wrapper/error.h @@ -219,10 +219,8 @@ PYOPENCL_USE_RESULT static PYOPENCL_INLINE T call_guarded(T (*func)(ArgTypes...), const char *name, ArgTypes2&&... args) { cl_int status_code = CL_SUCCESS; - // This magically turns off a weird gcc warning of uninitialized variable. - auto p = &status_code; - auto &_p = p; - auto argpack = make_clargpack(std::forward(args)..., _p); + auto status_arg = arg_buf(status_code); + auto argpack = make_clargpack(std::forward(args)..., status_arg); T res = argpack.clcall(func, name); if (status_code != CL_SUCCESS) { throw clerror(name, status_code);