From: ucag.li Date: Thu, 22 Aug 2024 19:49:45 +0000 (+0800) Subject: set NULL to ggml_context pointer to pass assert check in in case some compiler does... X-Git-Tag: upstream/0.0.1642~441 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=3e214c9556edecfb863452cbe30806b9f0bb9b08;p=pkg%2Fggml%2Fsources%2Fggml set NULL to ggml_context pointer to pass assert check in in case some compiler does not set uninitialized pointer to NULL for mnist example --- diff --git a/examples/mnist/mnist-common.cpp b/examples/mnist/mnist-common.cpp index cbed894c..f0e90bb0 100644 --- a/examples/mnist/mnist-common.cpp +++ b/examples/mnist/mnist-common.cpp @@ -74,8 +74,8 @@ mnist_eval_result mnist_graph_eval(const std::string & fname, const float * imag fprintf(stderr, "%s: trying to load a ggml graph from %s\n", __func__, fname.c_str()); mnist_eval_result result; - struct ggml_context * ctx_data; - struct ggml_context * ctx_eval; + struct ggml_context * ctx_data = nullptr; + struct ggml_context * ctx_eval = nullptr; struct ggml_cgraph * gf; {