Skip to content
Snippets Groups Projects
Commit 976f4a89 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Define macros to correctly remove unknown attributes warnings

- PRAGMA_DIAGNOSTIC_IGNORED_WATTRIBUTES
- PRAGMA_DIAGNOSTIC_POP
parent 71e76ee2
No related branches found
No related tags found
1 merge request!11Feature/mpi
#ifndef PASTIS_ASSERT_HPP
#define PASTIS_ASSERT_HPP
#include <PastisMacros.hpp>
#include <rang.hpp>
#include <iostream>
#include <string>
......@@ -45,14 +47,14 @@ class AssertError
~AssertError() = default;
};
#pragma GCC diagnostic ignored "-Wattributes"
PRAGMA_DIAGNOSTIC_IGNORED_WATTRIBUTES
inline bool
__attribute__((analyzer_noreturn))
_pastis_assert(const bool& assert)
{
return assert;
}
#pragma GCC diagnostic pop
PRAGMA_DIAGNOSTIC_POP
#ifdef NDEBUG
......
......@@ -10,4 +10,20 @@
#define PASTIS_LAMBDA KOKKOS_LAMBDA
// Sets macro to ignore unknown pragma
#if !defined(__clang__) and defined(__GNUC__)
#define PRAGMA_DIAGNOSTIC_IGNORED_WATTRIBUTES \
_Pragma ("GCC diagnostic ignored \"-Wattributes\"")
#define PRAGMA_DIAGNOSTIC_POP \
_Pragma ("GCC diagnostic pop")
#else // !defined(__clang__) and defined(__GNUC__)
#define PRAGMA_DIAGNOSTIC_IGNORED_WATTRIBUTES
#define PRAGMA_DIAGNOSTIC_POP
#endif
#endif // PASTIS_MACROS_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment