[clinfo] 03/36: Compile (cleanly) on GCC 4.4 too

Andreas Beckmann anbe at moszumanska.debian.org
Wed Feb 17 18:32:36 UTC 2016


This is an automated email from the git hooks/post-receive script.

anbe pushed a commit to branch master
in repository clinfo.

commit c7049b2f9bbabd35ce1ad07b7eabf7f4a744d37b
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date:   Wed Nov 11 11:29:00 2015 +0100

    Compile (cleanly) on GCC 4.4 too
---
 src/clinfo.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/clinfo.c b/src/clinfo.c
index 9598fc7..6005344 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -2430,12 +2430,18 @@ struct icdl_info_traits linfo_traits[] = {
 	LINFO(CL_ICDL_OCL_VERSION, "Profile")
 };
 
+/* GCC < 4.6 does not support the diagnostic push _inside_ the function,
+ * so we have to put it outside
+ */
+#if defined __GNUC__ && ((__GNUC__*10 + __GNUC_MINOR__) < 46)
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
 
 void oclIcdProps()
 {
 	/* We find the clGetICDLoaderInfoOCLICD extension address, and use it to query
 	 * the ICD loader properties. It should be noted however that
-	 * clGetExtensionFunctionAddress is marked * deprecated as of OpenCL 1.2, so
+	 * clGetExtensionFunctionAddress is marked deprecated as of OpenCL 1.2, so
 	 * to use it and compile cleanly we need disable the relevant warning.
 	 * It should be noted that in this specific case we cannot replace the
 	 * call to clGetExtensionFunctionAddress with a call to the superseding function
@@ -2446,7 +2452,7 @@ void oclIcdProps()
 #ifdef _MSC_VER
 #pragma warning(push)
 #pragma warning(disable : 4996)
-#else
+#elif defined __GNUC__ && ((__GNUC__*10 + __GNUC_MINOR__) >= 46)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
@@ -2455,7 +2461,7 @@ void oclIcdProps()
 
 #ifdef _MSC_VER
 #pragma warning(pop)
-#else
+#elif defined __GNUC__ && ((__GNUC__*10 + __GNUC_MINOR__) >= 46)
 #pragma GCC diagnostic pop
 #endif
 
@@ -2474,6 +2480,10 @@ void oclIcdProps()
 	}
 }
 
+#if defined __GNUC__ && ((__GNUC__*10 + __GNUC_MINOR__) < 46)
+#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+#endif
+
 void version()
 {
 	puts("clinfo version 2.0.15.04.28");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/clinfo.git



More information about the Pkg-opencl-commits mailing list