Xcode: resolve -Wunknown-pragmas

This is a multi-platform project and while trying to reduce amount of

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2024-02-14 10:32:45 +01:00
parent 2232b0d23e
commit 681a6955d8
9 changed files with 58 additions and 18 deletions

View File

@ -318,6 +318,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../include; HEADER_SEARCH_PATHS = ../include;
@ -375,6 +376,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../include; HEADER_SEARCH_PATHS = ../include;

View File

@ -9,7 +9,7 @@ using namespace std;
#ifdef _WIN32 #ifdef _WIN32
using namespace Microsoft::VisualStudio::CppUnitTestFramework; using namespace Microsoft::VisualStudio::CppUnitTestFramework;
#endif #endif
#ifdef __GNUC__ #if defined(__GNUC__)
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif #endif
@ -99,6 +99,6 @@ namespace UnitTests
} }
} }
#ifdef __GNUC__ #if defined(__GNUC__)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif

View File

@ -11,6 +11,11 @@
#include <string> #include <string>
#include <vector> #include <vector>
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#endif
namespace stdex namespace stdex
{ {
/// \cond internal /// \cond internal
@ -363,10 +368,8 @@ namespace stdex
size_t m_num; ///< Number of bytes used in `m_buf` size_t m_num; ///< Number of bytes used in `m_buf`
}; };
#ifdef _MSC_VER
#pragma warning(push) #pragma warning(push)
#pragma warning(disable: 26495) #pragma warning(disable: 26495)
#endif
/// ///
/// Converts from Base64 when reading from a stream /// Converts from Base64 when reading from a stream
@ -451,7 +454,9 @@ namespace stdex
m_temp_len; ///< Number of bytes of data in `m_temp` m_temp_len; ///< Number of bytes of data in `m_temp`
}; };
#ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#endif
} }
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

View File

@ -10,12 +10,15 @@
#include "stream.hpp" #include "stream.hpp"
#include <stdint.h> #include <stdint.h>
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#endif
namespace stdex namespace stdex
{ {
#ifdef _MSC_VER
#pragma warning(push) #pragma warning(push)
#pragma warning(disable: 26495) #pragma warning(disable: 26495)
#endif
/// ///
/// Basic hashing operations /// Basic hashing operations
@ -93,14 +96,10 @@ namespace stdex
memcpy(m_queue + j, data, remainder); memcpy(m_queue + j, data, remainder);
hash_block(); hash_block();
for (i = remainder; i + 64 <= length; i += 64) { for (i = remainder; i + 64 <= length; i += 64) {
#ifdef _MSC_VER
#pragma warning(push) #pragma warning(push)
#pragma warning(disable: 6385) #pragma warning(disable: 6385)
#endif
memcpy(m_queue, reinterpret_cast<const uint8_t*>(data) + i, 64); memcpy(m_queue, reinterpret_cast<const uint8_t*>(data) + i, 64);
#ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#endif
hash_block(); hash_block();
} }
@ -126,9 +125,7 @@ namespace stdex
}; };
}; };
#ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#endif
/// ///
/// Hashes read to or write from data of the stream /// Hashes read to or write from data of the stream
@ -644,3 +641,7 @@ namespace stdex
} }
}; };
} }
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

View File

@ -31,9 +31,12 @@
#include <string_view> #include <string_view>
#include <string> #include <string>
#ifdef _MSC_VER #if defined(_MSC_VER)
#pragma warning(push) #pragma warning(push)
#pragma warning(disable: 4100) #pragma warning(disable: 4100)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#endif #endif
#define ENUM_FLAG_OPERATOR(T,X) \ #define ENUM_FLAG_OPERATOR(T,X) \
@ -8386,6 +8389,8 @@ namespace stdex
#undef ENUM_FLAG_OPERATOR #undef ENUM_FLAG_OPERATOR
#undef ENUM_FLAGS #undef ENUM_FLAGS
#ifdef _MSC_VER #if defined(_MSC_VER)
#pragma warning(pop) #pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif #endif

View File

@ -10,6 +10,11 @@
#include <mutex> #include <mutex>
#include <tuple> #include <tuple>
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#endif
namespace stdex namespace stdex
{ {
/// ///
@ -147,3 +152,7 @@ namespace stdex
T m_data[N_cap]; T m_data[N_cap];
}; };
} }
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

View File

@ -34,6 +34,11 @@
#include <thread> #include <thread>
#include <vector> #include <vector>
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#endif
#if !defined(SET_FILE_OP_TIMES) && defined(RDAT_BELEZI_CAS_DOSTOPA_VER) #if !defined(SET_FILE_OP_TIMES) && defined(RDAT_BELEZI_CAS_DOSTOPA_VER)
#define SET_FILE_OP_TIMES 1 #define SET_FILE_OP_TIMES 1
#pragma message("RDAT_BELEZI_CAS_DOSTOPA_VER is deprecated. Use SET_FILE_OP_TIMES instead.") #pragma message("RDAT_BELEZI_CAS_DOSTOPA_VER is deprecated. Use SET_FILE_OP_TIMES instead.")
@ -4312,3 +4317,7 @@ namespace stdex
}; };
} }
} }
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

View File

@ -18,7 +18,7 @@
#include <memory> #include <memory>
#include <string> #include <string>
#ifdef __GNUC__ #if defined(__GNUC__)
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif #endif
@ -976,6 +976,6 @@ namespace stdex
#endif #endif
} }
#ifdef __GNUC__ #if defined(__GNUC__)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif

View File

@ -19,6 +19,11 @@
#include <memory> #include <memory>
#include <stdexcept> #include <stdexcept>
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#endif
namespace stdex namespace stdex
{ {
/// \cond internal /// \cond internal
@ -167,3 +172,7 @@ namespace stdex
std::unique_ptr<Byte[]> m_block; std::unique_ptr<Byte[]> m_block;
}; };
} }
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif