diff --git a/libmamba/ext/solv-cpp/src/pool.cpp b/libmamba/ext/solv-cpp/src/pool.cpp index 40c0568c7b..5a15f8a1db 100644 --- a/libmamba/ext/solv-cpp/src/pool.cpp +++ b/libmamba/ext/solv-cpp/src/pool.cpp @@ -95,15 +95,19 @@ namespace solv { // This function is only used in `assert()` expressions // That's why it might get reported as unused in Release builds +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" +#endif auto is_reldep(::Id id) -> bool { return ISRELDEP(static_cast>(id)) != 0; } +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic pop +#endif } auto ObjPoolView::get_string(StringId id) const -> std::string_view diff --git a/libmamba/src/core/run.cpp b/libmamba/src/core/run.cpp index 87f834d303..e9e88372a0 100644 --- a/libmamba/src/core/run.cpp +++ b/libmamba/src/core/run.cpp @@ -188,8 +188,10 @@ namespace mamba // This ctor only uses proc_dir_lock in `assert()` expression // That's why it might get reported as unused in Release builds +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" +#endif ScopedProcFile::ScopedProcFile( const Context& context, @@ -222,7 +224,9 @@ namespace mamba pid_file << file_json; } +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic pop +#endif ScopedProcFile::~ScopedProcFile() { diff --git a/libmamba/src/core/thread_utils.cpp b/libmamba/src/core/thread_utils.cpp index 4a04fb64cc..89e093e0dc 100644 --- a/libmamba/src/core/thread_utils.cpp +++ b/libmamba/src/core/thread_utils.cpp @@ -29,12 +29,14 @@ namespace mamba #ifndef _WIN32 namespace { -// `sigaddset` might be implemented as a macro calling `__sigbits(int)` function -// At the same time `sigset_t` might be `unsigned int` -// This causes compiler warning +#if defined(__APPLE__) && defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-conversion" +#endif + // `sigaddset` might be implemented as a macro calling `__sigbits(int)` function + // At the same time `sigset_t` might be `unsigned int` + // This causes compiler warning sigset_t get_sigset() { // block signals in this thread and subsequently @@ -46,7 +48,9 @@ namespace mamba return sigset; } +#if defined(__APPLE__) && defined(__GNUC__) #pragma GCC diagnostic pop +#endif std::thread::native_handle_type sig_recv_thread; std::atomic receiver_exists(false); diff --git a/libmamba/src/core/util.cpp b/libmamba/src/core/util.cpp index ab0d8440c3..de4cf9ef9d 100644 --- a/libmamba/src/core/util.cpp +++ b/libmamba/src/core/util.cpp @@ -973,8 +973,10 @@ namespace mamba // This function is only used in `assert()` expressions // That's why it might get reported as unused in Release builds +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" +#endif bool is_lockfile_locked(const LockFileOwner& lockfile) { @@ -986,7 +988,9 @@ namespace mamba #endif } +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic pop +#endif class LockedFilesRegistry { diff --git a/libmamba/src/solver/problems_graph.cpp b/libmamba/src/solver/problems_graph.cpp index 4a099a2202..e7c0ecef0d 100644 --- a/libmamba/src/solver/problems_graph.cpp +++ b/libmamba/src/solver/problems_graph.cpp @@ -265,7 +265,7 @@ namespace mamba::solver } // GCC reports dangling reference when using std::invoke with data members -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdangling-reference" #endif @@ -334,7 +334,7 @@ namespace mamba::solver } } -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic pop #endif