Skip to content
Snippets Groups Projects
Verified Commit 28254866 authored by raphael.bach's avatar raphael.bach
Browse files

Replace pragma to disable warnings with a less intrusive method

parent 9a305354
No related branches found
No related tags found
No related merge requests found
......@@ -48,28 +48,17 @@ struct fmpi_futhark_ctx;
#define FMPI_FUTHARK_ARRAY_ENTRY_LIST(D) \
CPL_MAP_FIXED(FMPI_PRIV_FUTHARK_ARRAY_ENTRY, CPL_COMMA, (D), FMPI_FUTHARK_TYPES)
#if defined(__GNUC__) || defined(__GNUG__)
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")
_Pragma("GCC diagnostic push")
#elif defined(__clang__)
_Pragma("clang diagnostic ignored \"-Wunused-parameter\"")
_Pragma("clang diagnostic push")
#endif
// In a comma separeted list of expressions contained in a pair of parentheses
// only the last one is returned, allowing to silence warnings about unused
// parameters by putting them first.
#define FMPI_FUTHARK_NEW_1(T, ctx, array, x, y, z) \
futhark_new_##T##_1d(ctx, array, (int64_t)(x));
((void)(y), (void)(z), futhark_new_##T##_1d(ctx, array, (int64_t)(x)))
#define FMPI_FUTHARK_NEW_2(T, ctx, array, x, y, z) \
futhark_new_##T##_2d(ctx, array, (int64_t)(x), (int64_t)(y));
#if defined(__GNUC__) || defined(__GNUG__)
_Pragma("GCC diagnostic push")
#elif defined(__clang__)
_Pragma("clang diagnostic push")
#endif
((void)(z), futhark_new_##T##_2d(ctx, array, (int64_t)(x), (int64_t)(y)))
#define FMPI_FUTHARK_NEW_3(T, ctx, array, x, y, z) \
futhark_new_##T##_3d(ctx, array, (int64_t)(x), (int64_t)(y), (int64_t)(z));
futhark_new_##T##_3d(ctx, array, (int64_t)(x), (int64_t)(y), (int64_t)(z))
#define FMPI_FUTHARK_DECLARATION(D, T) \
void * fmpi_futhark_new_##D##d_##T( \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment