aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-05-26 04:38:56 +0200
committerSven Göthel <[email protected]>2024-05-26 04:38:56 +0200
commitd718d505975349d015177c27ac4c8b65bd388574 (patch)
tree21eb5724a63261c86c5f5a49d58aba7da686b51e /include
parent50d9df5b86c512e2ce9868666e57a1372c4b9d24 (diff)
make: Ensure CC_FLAGS_WARNING is used for all (adding GCC), i.e. using pedantic etc; Adding PRAGMA to 'pause' pedantic and zero-length-array
Diffstat (limited to 'include')
-rw-r--r--include/jau/cpp_pragma.hpp13
-rw-r--r--include/jau/functional.hpp1
2 files changed, 14 insertions, 0 deletions
diff --git a/include/jau/cpp_pragma.hpp b/include/jau/cpp_pragma.hpp
index 2f706a6..43ab397 100644
--- a/include/jau/cpp_pragma.hpp
+++ b/include/jau/cpp_pragma.hpp
@@ -45,6 +45,11 @@ namespace jau {
#define PRAGMA_DISABLE_WARNING_FORMAT_OVERFLOW
#define PRAGMA_DISABLE_WARNING_FORMAT_NONLITERAL
#define PRAGMA_DISABLE_WARNING_PMF_CONVERSIONS
+ #define PRAGMA_DISABLE_WARNING_STRINGOP_OVERFLOW
+ #define PRAGMA_DISABLE_WARNING_INT_OVERFLOW
+ #define PRAGMA_DISABLE_WARNING_RESTRICT
+ #define PRAGMA_DISABLE_WARNING_PEDANTIC
+ #define PRAGMA_DISABLE_WARNING_ZERO_LENGTH_ARRAY
#elif defined(__GNUC__) || defined(__clang__)
#define DO_PRAGMA(X) _Pragma(#X)
@@ -65,11 +70,15 @@ namespace jau {
#define PRAGMA_DISABLE_WARNING_STRINGOP_OVERFLOW PRAGMA_DISABLE_WARNING(-Wstringop-overflow)
#define PRAGMA_DISABLE_WARNING_INT_OVERFLOW
#define PRAGMA_DISABLE_WARNING_RESTRICT PRAGMA_DISABLE_WARNING(-Wrestrict)
+ #define PRAGMA_DISABLE_WARNING_PEDANTIC PRAGMA_DISABLE_WARNING(-Wpedantic)
+ #define PRAGMA_DISABLE_WARNING_ZERO_LENGTH_ARRAY
#else
#define PRAGMA_DISABLE_WARNING_PMF_CONVERSIONS
#define PRAGMA_DISABLE_WARNING_STRINGOP_OVERFLOW
#define PRAGMA_DISABLE_WARNING_INT_OVERFLOW PRAGMA_DISABLE_WARNING(-Winteger-overflow)
#define PRAGMA_DISABLE_WARNING_RESTRICT
+ #define PRAGMA_DISABLE_WARNING_PEDANTIC PRAGMA_DISABLE_WARNING(-Wpedantic)
+ #define PRAGMA_DISABLE_WARNING_ZERO_LENGTH_ARRAY PRAGMA_DISABLE_WARNING(-Wzero-length-array)
#endif
#else
@@ -84,6 +93,10 @@ namespace jau {
#define PRAGMA_DISABLE_WARNING_FORMAT_NONLITERAL
#define PRAGMA_DISABLE_WARNING_PMF_CONVERSIONS
#define PRAGMA_DISABLE_WARNING_STRINGOP_OVERFLOW
+ #define PRAGMA_DISABLE_WARNING_INT_OVERFLOW
+ #define PRAGMA_DISABLE_WARNING_RESTRICT
+ #define PRAGMA_DISABLE_WARNING_PEDANTIC
+ #define PRAGMA_DISABLE_WARNING_ZERO_LENGTH_ARRAY
#endif
diff --git a/include/jau/functional.hpp b/include/jau/functional.hpp
index a7e9d53..63c993c 100644
--- a/include/jau/functional.hpp
+++ b/include/jau/functional.hpp
@@ -807,6 +807,7 @@ namespace jau {
{
PRAGMA_DISABLE_WARNING_PUSH
PRAGMA_DISABLE_WARNING_PMF_CONVERSIONS
+ PRAGMA_DISABLE_WARNING_PEDANTIC
function = (function_t)(_base->*_method);
PRAGMA_DISABLE_WARNING_POP
}