diff --git a/src/config_for_unittests.h b/src/config_for_unittests.h index 12bf614..bb6f224 100644 --- a/src/config_for_unittests.h +++ b/src/config_for_unittests.h @@ -63,3 +63,25 @@ #else # define PERFTOOLS_DLL_DECL // if DLL_DECL_FOR_UNITTESTS isn't defined, use "" #endif + +#if defined(__clang__) +#if __has_warning("-Wuse-after-free") +#pragma clang diagnostic ignored "-Wuse-after-free" +#endif +#if __has_warning("-Wunused-result") +#pragma clang diagnostic ignored "-Wunused-result" +#endif +#if __has_warning("-Wunused-private-field") +#pragma clang diagnostic ignored "-Wunused-private-field" +#endif +#if __has_warning("-Wimplicit-exception-spec-mismatch") +#pragma clang diagnostic ignored "-Wimplicit-exception-spec-mismatch" +#endif +#if __has_warning("-Wmissing-exception-spec") +#pragma clang diagnostic ignored "-Wmissing-exception-spec" +#endif +#elif defined(__GNUC__) +#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind +#pragma GCC diagnostic ignored "-Wuse-after-free" +#pragma GCC diagnostic ignored "-Wunused-result" +#endif diff --git a/src/tests/debugallocation_test.cc b/src/tests/debugallocation_test.cc index af50d55..020c983 100644 --- a/src/tests/debugallocation_test.cc +++ b/src/tests/debugallocation_test.cc @@ -31,6 +31,8 @@ // --- // Author: Fred Akalin +#include "config_for_unittests.h" + #include #include #include // for memcmp diff --git a/src/tests/profile-handler_unittest.cc b/src/tests/profile-handler_unittest.cc index d7678ba..3531bef 100644 --- a/src/tests/profile-handler_unittest.cc +++ b/src/tests/profile-handler_unittest.cc @@ -9,7 +9,8 @@ // // This file contains the unit tests for profile-handler.h interface. -#include "config.h" +#include "config_for_unittests.h" + #include "profile-handler.h" #include