Skip to content

Commit

Permalink
Ignoring OpenCL-related clang warnings
Browse files Browse the repository at this point in the history
There is simply no other way we can supress these warnings, as the
struct definition is out of our hands, and will depend from system to
system.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Dec 3, 2018
1 parent a5768da commit 5be8034
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions profit/opencl_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,21 @@

/*
* GCC 6 gives lots of "ignoring attributes on template arguments" warnings
* Until the cl2.hpp header files doesn't get a proper fix (it's taken from
* the official Kronos github) we simply turn the warnings off.
* because the built-in types have alignment attributes, and when these types
* are used as template parameters (e.g., when creating a vector<cl_int>) these
* attribute information is lost. This isn't an issue in reality though, and
* therefore we can safely disable this warning.
*
* Clang also complains about missing brances during the initialization of
* cl_image_desc structures because some systems define an anonymous union for
* the last member (which according to the spec is cl_mem buffer). Again,
* there's nothing we can do about this structure definition, and therefore we
* simply shut up the warnings.
*/
#if defined __GNUC__ && __GNUC__>=6
# pragma GCC diagnostic ignored "-Wignored-attributes"
#elif defined __clang__
# pragma clang diagnostic ignored "-Wmissing-braces"
#endif
#include "profit/cl/cl2.hpp"

Expand Down

0 comments on commit 5be8034

Please sign in to comment.