Skip to content

Commit 75bfcce

Browse files
committed
fix: resolve deprecated-declarations warnings with gcc15
1 parent 8dce385 commit 75bfcce

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

common/common.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,11 +706,17 @@ bool fs_validate_filename(const std::string & filename) {
706706
// disable C++17 deprecation warning for std::codecvt_utf8
707707
# pragma clang diagnostic push
708708
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
709+
#elif defined(__GNUC__)
710+
# pragma GCC diagnostic push
711+
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
709712
#endif
713+
710714
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> converter;
711715

712716
#if defined(__clang__)
713717
# pragma clang diagnostic pop
718+
#elif defined(__GNUC__)
719+
# pragma GCC diagnostic pop
714720
#endif
715721

716722
filename_utf32 = converter.from_bytes(filename);

ggml/src/ggml-backend-reg.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
#if defined(__clang__)
7070
# pragma clang diagnostic push
7171
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
72+
#elif defined(__GNUC__)
73+
# pragma GCC diagnostic push
74+
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
7275
#endif
7376

7477
namespace fs = std::filesystem;
@@ -91,6 +94,8 @@ static std::string path_str(const fs::path & path) {
9194

9295
#if defined(__clang__)
9396
# pragma clang diagnostic pop
97+
#elif defined(__GNUC__)
98+
# pragma GCC diagnostic pop
9499
#endif
95100

96101
#ifdef _WIN32

src/unicode.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,17 @@ static inline std::wstring unicode_wstring_from_utf8(const std::string & s) {
204204
// disable C++17 deprecation warning for std::codecvt_utf8
205205
# pragma clang diagnostic push
206206
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
207+
#elif defined(__GNUC__)
208+
# pragma GCC diagnostic push
209+
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
207210
#endif
208211

209212
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
210213

211214
#if defined(__clang__)
212215
# pragma clang diagnostic pop
216+
#elif defined(__GNUC__)
217+
# pragma GCC diagnostic pop
213218
#endif
214219

215220
return conv.from_bytes(s);

0 commit comments

Comments
 (0)