unicode : silence gcc warnings

ggml-ci
This commit is contained in:
Georgi Gerganov 2025-01-18 12:01:41 +02:00
parent 84aef8dfa8
commit 9945478438
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -7,18 +7,26 @@
#include <algorithm>
#include <cassert>
#include <codecvt>
#include <cstddef>
#include <cstdint>
#include <locale>
#include <map>
// silence warnings triggered by a gcc bug when using sanitizers
// ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105562#c21
#pragma GCC diagnostic push
#if defined __SANITIZE_ADDRESS__ && defined __OPTIMIZE__
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include <regex>
#pragma GCC diagnostic pop
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <locale>
#include <codecvt>
size_t unicode_len_utf8(char src) {
const size_t lookup[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 4 };