From ecd6ec41c6507bd6f3a63105efc795a76c634342 Mon Sep 17 00:00:00 2001 From: Shaw Date: Tue, 19 May 2026 03:41:41 -0700 Subject: [PATCH] ci(3rd-party): drop -Wconversion from omnivoice; widen debug src1_str buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two follow-ups for LLAMA_FATAL_WARNINGS=ON (CI 3rd-party / ubuntu-24-llguidance): omnivoice_lib still tripped `-Werror=conversion` after PR #21: src/llama-adapter.h:86:30: error: conversion from std::unordered_map<...>::size_type (aka unsigned long) to uint32_t may change value [-Werror=conversion] Same rationale as the -Wshadow carve-out — the warning is in upstream llama core headers, not omnivoice code. Drop -Wconversion from omnivoice_lib's compile options. -Wno-sign-conversion is already dropped further down so the variable now has no purpose; remove it. common/debug.cpp tripped -Werror=format-truncation= at line 167: '}' directive output may be truncated writing 1 byte into a region of size between 0 and 127 The src1_str buffer was 256 bytes for a snprintf of '%s{%s}' where src1->name can be up to GGML_MAX_NAME=128 (omnivoice bumps the default 64 to 128 PUBLIC on ggml). GCC can't prove the bound and rejects the write. Widen the buffer to 512 to give the worst-case name + shape string headroom. --- common/debug.cpp | 6 +++++- tools/omnivoice/CMakeLists.txt | 9 +++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index fff040c06..021117ec4 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -162,7 +162,11 @@ bool common_debug_cb_eval(struct ggml_tensor * t, bool ask, void * user_data) { } } - char src1_str[256] = { 0 }; + // Buffer must fit `src1->name` (up to GGML_MAX_NAME, which omnivoice + // bumps to 128) plus the bracketed shape string. Stay well above the + // worst case so -Werror=format-truncation on CI 3rd-party doesn't + // reject a write the compiler can't prove is bounded. + char src1_str[512] = { 0 }; if (src1) { snprintf(src1_str, sizeof(src1_str), "%s{%s}", src1->name, common_ggml_ne_string(src1).c_str()); } diff --git a/tools/omnivoice/CMakeLists.txt b/tools/omnivoice/CMakeLists.txt index 8cb2091d7..cf965da3f 100644 --- a/tools/omnivoice/CMakeLists.txt +++ b/tools/omnivoice/CMakeLists.txt @@ -105,12 +105,13 @@ if(MSVC) target_compile_options(omnivoice_lib PRIVATE /W4 /wd4100 /wd4505) else() - # -Wshadow intentionally omitted: omnivoice sources include llama's - # private headers + the public ggml-backend.h, neither of which are - # shadow-clean upstream. Under -DLLAMA_FATAL_WARNINGS=ON those + # -Wshadow / -Wconversion intentionally omitted: omnivoice sources + # include llama's private headers (src/llama-arch.h, llama-adapter.h) + # and the public ggml-backend.h, none of which are shadow- or + # conversion-clean upstream. Under -DLLAMA_FATAL_WARNINGS=ON those # warnings escalate to -Werror and break the 3rd-party CI lane. target_compile_options(omnivoice_lib PRIVATE - -Wall -Wextra -Wconversion + -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-sign-conversion) endif()