From: Jared Van Bortel Date: Mon, 27 Nov 2023 03:58:43 +0000 (-0500) Subject: ggml : fix -Warray-bounds warning with gcc (#4231) X-Git-Tag: upstream/0.0.4488~2917 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=f3b269813f6147c5b5cda082e6b45cf04a932e0d;p=pkg%2Fggml%2Fsources%2Fllama.cpp ggml : fix -Warray-bounds warning with gcc (#4231) --- diff --git a/ggml.c b/ggml.c index f92292b3..0c7264a3 100644 --- a/ggml.c +++ b/ggml.c @@ -15689,13 +15689,14 @@ static int ggml_get_n_tasks(struct ggml_tensor * node, int n_threads) { { n_tasks = 1; } break; - case GGML_OP_COUNT: - { - GGML_ASSERT(false); - } break; default: { - printf("%s: op %s not implemented\n", __func__, ggml_op_name(node->op)); + fprintf(stderr, "%s: op not implemented: ", __func__); + if (node->op < GGML_OP_COUNT) { + fprintf(stderr, "%s\n", ggml_op_name(node->op)); + } else { + fprintf(stderr, "%d\n", node->op); + } GGML_ASSERT(false); } break; }