summaryrefslogtreecommitdiffstats
path: root/testsuites/support/include/tmacros.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-11-19 13:57:37 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-11-20 12:57:33 -0600
commit163519a055c355a5ae023122f43f68395dee2c2f (patch)
treef0d7c9c0237c90547fa060ae5d910574b07c8cdf /testsuites/support/include/tmacros.h
parentlibdl/rtl-mdreloc-powerpc.c: Fix warnings (diff)
downloadrtems-163519a055c355a5ae023122f43f68395dee2c2f.tar.bz2
libtests/malloctest/init.c: Fix warning
posix_memalign() is prototyped to take a non-NULL parameter. But our test is deliberately passing one in. With the -Wnon-null warning flag enabled, we will always get warnings on this test unless we disable that warning for this single test case.
Diffstat (limited to 'testsuites/support/include/tmacros.h')
-rw-r--r--testsuites/support/include/tmacros.h32
1 files changed, 27 insertions, 5 deletions
diff --git a/testsuites/support/include/tmacros.h b/testsuites/support/include/tmacros.h
index 91f23e0e02..4524cf9eb7 100644
--- a/testsuites/support/include/tmacros.h
+++ b/testsuites/support/include/tmacros.h
@@ -1,9 +1,12 @@
-/* tmacros.h
+/**
+ * @file
*
- * This include file contains macros which are useful in the RTEMS
- * test suites.
- *
- * COPYRIGHT (c) 1989-2009.
+ * This include file contains macros which are useful in the RTEMS
+ * test suites.
+ */
+
+/*
+ * COPYRIGHT (c) 1989-2014.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -297,6 +300,25 @@ extern "C" {
/* newlib's ino_t is a typedef to "unsigned long" */
#define PRIxino_t "lx"
+/**
+ * This assists in clearly disabling warnings on GCC in certain very
+ * specific cases.
+ *
+ * + -Wnon-null - If a method is declared as never having a NULL first
+ * parameter. We need to explicitly disable this compiler warning to make
+ * the code warning free.
+ */
+#ifdef __GNUC__
+ #define COMPILER_DIAGNOSTIC_SETTINGS_PUSH _Pragma("GCC diagnostic push")
+ #define COMPILER_DIAGNOSTIC_SETTINGS_POP _Pragma("GCC diagnostic pop")
+ #define COMPILER_DIAGNOSTIC_SETTINGS_DISABLE_NONNULL \
+ _Pragma("GCC diagnostic ignored \"-Wnonnull\"")
+#else
+ #define COMPILER_DIAGNOSTIC_SETTINGS_PUSH
+ #define COMPILER_DIAGNOSTIC_SETTINGS_POP
+ #define COMPILER_DIAGNOSTIC_SETTINGS_DISABLE_NONNULL
+#endif
+
#ifdef __cplusplus
}
#endif