diff mbox series

[v2,1/1] test: workaround buggy CUnit header

Message ID 1513944009-27633-2-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [v2,1/1] test: workaround buggy CUnit header | expand

Commit Message

Github ODP bot Dec. 22, 2017, noon UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Make GCC ignore following error:
In file included from odp_cunit_common.h:20:0,
                 from odp_cunit_common.c:13:
/home/travis/cunit-install/include/CUnit/Automated.h:90:1: error: function declaration isn’t a prototype [-Werror=strict-prototypes]
 const char *CU_automated_package_name_get();
 ^
cc1: all warnings being treated as errors

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 364 (lumag:fix-cunit-automated)
 ** https://github.com/Linaro/odp/pull/364
 ** Patch: https://github.com/Linaro/odp/pull/364.patch
 ** Base sha: 4c4052f894b8df5784d2aae2e36b96796ee020fd
 ** Merge commit sha: 5de0d769b4201b2a63d0012b24f043e62d7b4c43
 **/
 test/common/odp_cunit_common.c | 12 ++++++++++++
 test/common/odp_cunit_common.h |  2 --
 2 files changed, 12 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/test/common/odp_cunit_common.c b/test/common/odp_cunit_common.c
index 55a39d910..faa67733f 100644
--- a/test/common/odp_cunit_common.c
+++ b/test/common/odp_cunit_common.c
@@ -12,6 +12,18 @@ 
 #include <odp_api.h>
 #include "odp_cunit_common.h"
 #include <odp/helper/odph_api.h>
+
+#include <CUnit/TestDB.h>
+
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-prototypes"
+#endif
+#include <CUnit/Automated.h>
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic pop
+#endif
+
 /* Globals */
 static odph_odpthread_t thread_tbl[MAX_WORKERS];
 static odp_instance_t instance;
diff --git a/test/common/odp_cunit_common.h b/test/common/odp_cunit_common.h
index 3727a4259..390e8f57b 100644
--- a/test/common/odp_cunit_common.h
+++ b/test/common/odp_cunit_common.h
@@ -16,8 +16,6 @@ 
 #include <stdint.h>
 #include <inttypes.h>
 #include <CUnit/Basic.h>
-#include <CUnit/TestDB.h>
-#include <CUnit/Automated.h>
 #include <odp_api.h>
 
 #define MAX_WORKERS 32 /**< Maximum number of work threads */