From 8afd8487f8437e161aeba76ebff859280606b80c Mon Sep 17 00:00:00 2001 From: Dave Goodell Date: Mon, 5 Jan 2015 14:41:42 -0800 Subject: [PATCH] opal_stdint.h: fix "#pragma GCC" warnings This was more complicated than I would like, but it's just an unfortunate GCC/clang difference. I don't have access to all the C compilers out there, so this may still have problems with other compilers that implement some form of `#pragma GCC diagnostic` support but don't actually behave the same as some versions of GCC. fixes #323 --- opal/include/opal_stdint.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/opal/include/opal_stdint.h b/opal/include/opal_stdint.h index 4d8587109b..d08b22073b 100644 --- a/opal/include/opal_stdint.h +++ b/opal/include/opal_stdint.h @@ -147,7 +147,14 @@ typedef uint128_t opal_uint128_t; /* suppress warning about __int128 type */ #pragma GCC diagnostic push +/* Clang won't quietly accept "-pedantic", but GCC versions older than ~4.8 + * won't quietly accept "-Wpedanic". The whole "#pragma GCC diagnostic ..." + * facility only was added to GCC as of version 4.6. */ +#if defined(__clang__) #pragma GCC diagnostic ignored "-Wpedantic" +#else +#pragma GCC diagnostic ignored "-pedantic" +#endif typedef __int128 opal_int128_t; typedef unsigned __int128 opal_uint128_t; #pragma GCC diagnostic pop