simde-diagnostic.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. /* SPDX-License-Identifier: MIT
  2. *
  3. * Permission is hereby granted, free of charge, to any person
  4. * obtaining a copy of this software and associated documentation
  5. * files (the "Software"), to deal in the Software without
  6. * restriction, including without limitation the rights to use, copy,
  7. * modify, merge, publish, distribute, sublicense, and/or sell copies
  8. * of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be
  12. * included in all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  17. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  18. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  19. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  20. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21. * SOFTWARE.
  22. *
  23. * Copyright:
  24. * 2017-2020 Evan Nemerson <[email protected]>
  25. */
  26. /* SIMDe targets a very wide range of standards and compilers, and our
  27. * goal is to compile cleanly even with extremely aggressive warnings
  28. * (i.e., -Weverything in clang, -Wextra in GCC, /W4 for MSVC, etc.)
  29. * treated as errors.
  30. *
  31. * While our preference is to resolve the underlying issue a given
  32. * diagnostic is warning us about, sometimes that's not possible.
  33. * Fixing a warning in one compiler may cause problems in another.
  34. * Sometimes a warning doesn't really apply to us (false positives),
  35. * and sometimes adhering to a warning would mean dropping a feature
  36. * we *know* the compiler supports since we have tested specifically
  37. * for the compiler or feature.
  38. *
  39. * When practical, warnings are only disabled for specific code. For
  40. * a list of warnings which are enabled by default in all SIMDe code,
  41. * see SIMDE_DISABLE_UNWANTED_DIAGNOSTICS. Note that we restore the
  42. * warning stack when SIMDe is done parsing, so code which includes
  43. * SIMDe is not deprived of these warnings.
  44. */
  45. #if !defined(SIMDE_DIAGNOSTIC_H)
  46. #define SIMDE_DIAGNOSTIC_H
  47. #include "hedley.h"
  48. #include "simde-detect-clang.h"
  49. /* This is only to help us implement functions like _mm_undefined_ps. */
  50. #if defined(SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_)
  51. #undef SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_
  52. #endif
  53. #if HEDLEY_HAS_WARNING("-Wuninitialized")
  54. #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ \
  55. _Pragma("clang diagnostic ignored \"-Wuninitialized\"")
  56. #elif HEDLEY_GCC_VERSION_CHECK(4, 2, 0)
  57. #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ \
  58. _Pragma("GCC diagnostic ignored \"-Wuninitialized\"")
  59. #elif HEDLEY_PGI_VERSION_CHECK(19, 10, 0)
  60. #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ _Pragma("diag_suppress 549")
  61. #elif HEDLEY_SUNPRO_VERSION_CHECK(5, 14, 0) && defined(__cplusplus)
  62. #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ \
  63. _Pragma("error_messages(off,SEC_UNINITIALIZED_MEM_READ,SEC_UNDEFINED_RETURN_VALUE,unassigned)")
  64. #elif HEDLEY_SUNPRO_VERSION_CHECK(5, 14, 0)
  65. #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ \
  66. _Pragma("error_messages(off,SEC_UNINITIALIZED_MEM_READ,SEC_UNDEFINED_RETURN_VALUE)")
  67. #elif HEDLEY_SUNPRO_VERSION_CHECK(5, 12, 0) && defined(__cplusplus)
  68. #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ \
  69. _Pragma("error_messages(off,unassigned)")
  70. #elif HEDLEY_TI_VERSION_CHECK(16, 9, 9) || \
  71. HEDLEY_TI_CL6X_VERSION_CHECK(8, 0, 0) || \
  72. HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
  73. HEDLEY_TI_CLPRU_VERSION_CHECK(2, 3, 2)
  74. #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ _Pragma("diag_suppress 551")
  75. #elif HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)
  76. #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ _Pragma("warning(disable:592)")
  77. #elif HEDLEY_MSVC_VERSION_CHECK(19, 0, 0) && !defined(__MSVC_RUNTIME_CHECKS)
  78. #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ \
  79. __pragma(warning(disable : 4700))
  80. #endif
  81. /* GCC emits a lot of "notes" about the ABI being different for things
  82. * in newer versions of GCC. We don't really care because all our
  83. * functions are inlined and don't generate ABI. */
  84. #if HEDLEY_GCC_VERSION_CHECK(7, 0, 0)
  85. #define SIMDE_DIAGNOSTIC_DISABLE_PSABI_ \
  86. _Pragma("GCC diagnostic ignored \"-Wpsabi\"")
  87. #else
  88. #define SIMDE_DIAGNOSTIC_DISABLE_PSABI_
  89. #endif
  90. /* Since MMX uses x87 FP registers, you're supposed to call _mm_empty()
  91. * after each MMX function before any floating point instructions.
  92. * Some compilers warn about functions which use MMX functions but
  93. * don't call _mm_empty(). However, since SIMDe is implementyng the
  94. * MMX API we shouldn't be calling _mm_empty(); we leave it to the
  95. * caller to invoke simde_mm_empty(). */
  96. #if HEDLEY_INTEL_VERSION_CHECK(19, 0, 0)
  97. #define SIMDE_DIAGNOSTIC_DISABLE_NO_EMMS_INSTRUCTION_ \
  98. _Pragma("warning(disable:13200 13203)")
  99. #elif defined(HEDLEY_MSVC_VERSION)
  100. #define SIMDE_DIAGNOSTIC_DISABLE_NO_EMMS_INSTRUCTION_ \
  101. __pragma(warning(disable : 4799))
  102. #else
  103. #define SIMDE_DIAGNOSTIC_DISABLE_NO_EMMS_INSTRUCTION_
  104. #endif
  105. /* Intel is pushing people to use OpenMP SIMD instead of Cilk+, so they
  106. * emit a diagnostic if you use #pragma simd instead of
  107. * #pragma omp simd. SIMDe supports OpenMP SIMD, you just need to
  108. * compile with -qopenmp or -qopenmp-simd and define
  109. * SIMDE_ENABLE_OPENMP. Cilk+ is just a fallback. */
  110. #if HEDLEY_INTEL_VERSION_CHECK(18, 0, 0)
  111. #define SIMDE_DIAGNOSTIC_DISABLE_SIMD_PRAGMA_DEPRECATED_ \
  112. _Pragma("warning(disable:3948)")
  113. #else
  114. #define SIMDE_DIAGNOSTIC_DISABLE_SIMD_PRAGMA_DEPRECATED_
  115. #endif
  116. /* MSVC emits a diagnostic when we call a function (like
  117. * simde_mm_set_epi32) while initializing a struct. We currently do
  118. * this a *lot* in the tests. */
  119. #if defined(HEDLEY_MSVC_VERSION)
  120. #define SIMDE_DIAGNOSTIC_DISABLE_NON_CONSTANT_AGGREGATE_INITIALIZER_ \
  121. __pragma(warning(disable : 4204))
  122. #else
  123. #define SIMDE_DIAGNOSTIC_DISABLE_NON_CONSTANT_AGGREGATE_INITIALIZER_
  124. #endif
  125. /* This warning needs a lot of work. It is triggered if all you do is
  126. * pass the value to memcpy/__builtin_memcpy, or if you initialize a
  127. * member of the union, even if that member takes up the entire union.
  128. * Last tested with clang-10, hopefully things will improve in the
  129. * future; if clang fixes this I'd love to enable it. */
  130. #if HEDLEY_HAS_WARNING("-Wconditional-uninitialized")
  131. #define SIMDE_DIAGNOSTIC_DISABLE_CONDITIONAL_UNINITIALIZED_ \
  132. _Pragma("clang diagnostic ignored \"-Wconditional-uninitialized\"")
  133. #else
  134. #define SIMDE_DIAGNOSTIC_DISABLE_CONDITIONAL_UNINITIALIZED_
  135. #endif
  136. /* This warning is meant to catch things like `0.3 + 0.4 == 0.7`, which
  137. * will is false. However, SIMDe uses these operations exclusively
  138. * for things like _mm_cmpeq_ps, for which we really do want to check
  139. * for equality (or inequality).
  140. *
  141. * If someone wants to put together a SIMDE_FLOAT_EQUAL(a, op, b) macro
  142. * which just wraps a check in some code do disable this diagnostic I'd
  143. * be happy to accept it. */
  144. #if HEDLEY_HAS_WARNING("-Wfloat-equal") || HEDLEY_GCC_VERSION_CHECK(3, 0, 0)
  145. #define SIMDE_DIAGNOSTIC_DISABLE_FLOAT_EQUAL_ \
  146. _Pragma("GCC diagnostic ignored \"-Wfloat-equal\"")
  147. #else
  148. #define SIMDE_DIAGNOSTIC_DISABLE_FLOAT_EQUAL_
  149. #endif
  150. /* This is because we use HEDLEY_STATIC_ASSERT for static assertions.
  151. * If Hedley can't find an implementation it will preprocess to
  152. * nothing, which means there will be a trailing semi-colon. */
  153. #if HEDLEY_HAS_WARNING("-Wextra-semi")
  154. #define SIMDE_DIAGNOSTIC_DISABLE_EXTRA_SEMI_ \
  155. _Pragma("clang diagnostic ignored \"-Wextra-semi\"")
  156. #elif HEDLEY_GCC_VERSION_CHECK(8, 1, 0) && defined(__cplusplus)
  157. #define SIMDE_DIAGNOSTIC_DISABLE_EXTRA_SEMI_ \
  158. _Pragma("GCC diagnostic ignored \"-Wextra-semi\"")
  159. #else
  160. #define SIMDE_DIAGNOSTIC_DISABLE_EXTRA_SEMI_
  161. #endif
  162. /* We do use a few variadic macros, which technically aren't available
  163. * until C99 and C++11, but every compiler I'm aware of has supported
  164. * them for much longer. That said, usage is isolated to the test
  165. * suite and compilers known to support them. */
  166. #if HEDLEY_HAS_WARNING("-Wvariadic-macros") || HEDLEY_GCC_VERSION_CHECK(4, 0, 0)
  167. #if HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic")
  168. #define SIMDE_DIAGNOSTIC_DISABLE_VARIADIC_MACROS_ \
  169. _Pragma("clang diagnostic ignored \"-Wvariadic-macros\"") _Pragma( \
  170. "clang diagnostic ignored \"-Wc++98-compat-pedantic\"")
  171. #else
  172. #define SIMDE_DIAGNOSTIC_DISABLE_VARIADIC_MACROS_ \
  173. _Pragma("GCC diagnostic ignored \"-Wvariadic-macros\"")
  174. #endif
  175. #else
  176. #define SIMDE_DIAGNOSTIC_DISABLE_VARIADIC_MACROS_
  177. #endif
  178. /* emscripten requires us to use a __wasm_unimplemented_simd128__ macro
  179. * before we can access certain SIMD intrinsics, but this diagnostic
  180. * warns about it being a reserved name. It is a reserved name, but
  181. * it's reserved for the compiler and we are using it to convey
  182. * information to the compiler.
  183. *
  184. * This is also used when enabling native aliases since we don't get to
  185. * choose the macro names. */
  186. #if HEDLEY_HAS_WARNING("-Wdouble-promotion")
  187. #define SIMDE_DIAGNOSTIC_DISABLE_RESERVED_ID_MACRO_ \
  188. _Pragma("clang diagnostic ignored \"-Wreserved-id-macro\"")
  189. #else
  190. #define SIMDE_DIAGNOSTIC_DISABLE_RESERVED_ID_MACRO_
  191. #endif
  192. /* clang 3.8 warns about the packed attribute being unnecessary when
  193. * used in the _mm_loadu_* functions. That *may* be true for version
  194. * 3.8, but for later versions it is crucial in order to make unaligned
  195. * access safe. */
  196. #if HEDLEY_HAS_WARNING("-Wpacked")
  197. #define SIMDE_DIAGNOSTIC_DISABLE_PACKED_ \
  198. _Pragma("clang diagnostic ignored \"-Wpacked\"")
  199. #else
  200. #define SIMDE_DIAGNOSTIC_DISABLE_PACKED_
  201. #endif
  202. /* Triggered when assigning a float to a double implicitly. We use
  203. * explicit casts in SIMDe, this is only used in the test suite. */
  204. #if HEDLEY_HAS_WARNING("-Wdouble-promotion")
  205. #define SIMDE_DIAGNOSTIC_DISABLE_DOUBLE_PROMOTION_ \
  206. _Pragma("clang diagnostic ignored \"-Wdouble-promotion\"")
  207. #else
  208. #define SIMDE_DIAGNOSTIC_DISABLE_DOUBLE_PROMOTION_
  209. #endif
  210. /* Several compilers treat conformant array parameters as VLAs. We
  211. * test to make sure we're in C mode (C++ doesn't support CAPs), and
  212. * that the version of the standard supports CAPs. We also reject
  213. * some buggy compilers like MSVC (the logic is in Hedley if you want
  214. * to take a look), but with certain warnings enabled some compilers
  215. * still like to emit a diagnostic. */
  216. #if HEDLEY_HAS_WARNING("-Wvla")
  217. #define SIMDE_DIAGNOSTIC_DISABLE_VLA_ \
  218. _Pragma("clang diagnostic ignored \"-Wvla\"")
  219. #elif HEDLEY_GCC_VERSION_CHECK(4, 3, 0)
  220. #define SIMDE_DIAGNOSTIC_DISABLE_VLA_ \
  221. _Pragma("GCC diagnostic ignored \"-Wvla\"")
  222. #else
  223. #define SIMDE_DIAGNOSTIC_DISABLE_VLA_
  224. #endif
  225. #if HEDLEY_HAS_WARNING("-Wused-but-marked-unused")
  226. #define SIMDE_DIAGNOSTIC_DISABLE_USED_BUT_MARKED_UNUSED_ \
  227. _Pragma("clang diagnostic ignored \"-Wused-but-marked-unused\"")
  228. #else
  229. #define SIMDE_DIAGNOSTIC_DISABLE_USED_BUT_MARKED_UNUSED_
  230. #endif
  231. #if HEDLEY_HAS_WARNING("-Wunused-function")
  232. #define SIMDE_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION_ \
  233. _Pragma("clang diagnostic ignored \"-Wunused-function\"")
  234. #elif HEDLEY_GCC_VERSION_CHECK(3, 4, 0)
  235. #define SIMDE_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION_ \
  236. _Pragma("GCC diagnostic ignored \"-Wunused-function\"")
  237. #elif HEDLEY_MSVC_VERSION_CHECK(19, 0, 0) /* Likely goes back further */
  238. #define SIMDE_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION_ \
  239. __pragma(warning(disable : 4505))
  240. #else
  241. #define SIMDE_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION_
  242. #endif
  243. #if HEDLEY_HAS_WARNING("-Wpass-failed")
  244. #define SIMDE_DIAGNOSTIC_DISABLE_PASS_FAILED_ \
  245. _Pragma("clang diagnostic ignored \"-Wpass-failed\"")
  246. #else
  247. #define SIMDE_DIAGNOSTIC_DISABLE_PASS_FAILED_
  248. #endif
  249. #if HEDLEY_HAS_WARNING("-Wpadded")
  250. #define SIMDE_DIAGNOSTIC_DISABLE_PADDED_ \
  251. _Pragma("clang diagnostic ignored \"-Wpadded\"")
  252. #elif HEDLEY_MSVC_VERSION_CHECK(19, 0, 0) /* Likely goes back further */
  253. #define SIMDE_DIAGNOSTIC_DISABLE_PADDED_ __pragma(warning(disable : 4324))
  254. #else
  255. #define SIMDE_DIAGNOSTIC_DISABLE_PADDED_
  256. #endif
  257. #if HEDLEY_HAS_WARNING("-Wzero-as-null-pointer-constant")
  258. #define SIMDE_DIAGNOSTIC_DISABLE_ZERO_AS_NULL_POINTER_CONSTANT_ \
  259. _Pragma("clang diagnostic ignored \"-Wzero-as-null-pointer-constant\"")
  260. #else
  261. #define SIMDE_DIAGNOSTIC_DISABLE_ZERO_AS_NULL_POINTER_CONSTANT_
  262. #endif
  263. #if HEDLEY_HAS_WARNING("-Wold-style-cast")
  264. #define SIMDE_DIAGNOSTIC_DISABLE_OLD_STYLE_CAST_ \
  265. _Pragma("clang diagnostic ignored \"-Wold-style-cast\"")
  266. #else
  267. #define SIMDE_DIAGNOSTIC_DISABLE_OLD_STYLE_CAST_
  268. #endif
  269. #if HEDLEY_HAS_WARNING("-Wcast-function-type") || \
  270. HEDLEY_GCC_VERSION_CHECK(8, 0, 0)
  271. #define SIMDE_DIAGNOSTIC_DISABLE_CAST_FUNCTION_TYPE_ \
  272. _Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
  273. #else
  274. #define SIMDE_DIAGNOSTIC_DISABLE_CAST_FUNCTION_TYPE_
  275. #endif
  276. /* clang will emit this warning when we use C99 extensions whan not in
  277. * C99 mode, even though it does support this. In such cases we check
  278. * the compiler and version first, so we know it's not a problem. */
  279. #if HEDLEY_HAS_WARNING("-Wc99-extensions")
  280. #define SIMDE_DIAGNOSTIC_DISABLE_C99_EXTENSIONS_ \
  281. _Pragma("clang diagnostic ignored \"-Wc99-extensions\"")
  282. #else
  283. #define SIMDE_DIAGNOSTIC_DISABLE_C99_EXTENSIONS_
  284. #endif
  285. /* https://github.com/simd-everywhere/simde/issues/277 */
  286. #if defined(HEDLEY_GCC_VERSION) && HEDLEY_GCC_VERSION_CHECK(4, 6, 0) && \
  287. !HEDLEY_GCC_VERSION_CHECK(6, 4, 0) && defined(__cplusplus)
  288. #define SIMDE_DIAGNOSTIC_DISABLE_BUGGY_UNUSED_BUT_SET_VARIBALE_ \
  289. _Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"")
  290. #else
  291. #define SIMDE_DIAGNOSTIC_DISABLE_BUGGY_UNUSED_BUT_SET_VARIBALE_
  292. #endif
  293. /* This is the warning that you normally define _CRT_SECURE_NO_WARNINGS
  294. * to silence, but you have to do that before including anything and
  295. * that would require reordering includes. */
  296. #if defined(_MSC_VER)
  297. #define SIMDE_DIAGNOSTIC_DISABLE_ANNEX_K_ __pragma(warning(disable : 4996))
  298. #else
  299. #define SIMDE_DIAGNOSTIC_DISABLE_ANNEX_K_
  300. #endif
  301. /* Some compilers, such as clang, may use `long long` for 64-bit
  302. * integers, but `long long` triggers a diagnostic with
  303. * -Wc++98-compat-pedantic which says 'long long' is incompatible with
  304. * C++98. */
  305. #if HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic")
  306. #define SIMDE_DIAGNOSTIC_DISABLE_CPP98_COMPAT_PEDANTIC_ \
  307. _Pragma("clang diagnostic ignored \"-Wc++98-compat-pedantic\"")
  308. #else
  309. #define SIMDE_DIAGNOSTIC_DISABLE_CPP98_COMPAT_PEDANTIC_
  310. #endif
  311. /* Some problem as above */
  312. #if HEDLEY_HAS_WARNING("-Wc++11-long-long")
  313. #define SIMDE_DIAGNOSTIC_DISABLE_CPP11_LONG_LONG_ \
  314. _Pragma("clang diagnostic ignored \"-Wc++11-long-long\"")
  315. #else
  316. #define SIMDE_DIAGNOSTIC_DISABLE_CPP11_LONG_LONG_
  317. #endif
  318. /* emscripten emits this whenever stdin/stdout/stderr is used in a
  319. * macro. */
  320. #if HEDLEY_HAS_WARNING("-Wdisabled-macro-expansion")
  321. #define SIMDE_DIAGNOSTIC_DISABLE_DISABLED_MACRO_EXPANSION_ \
  322. _Pragma("clang diagnostic ignored \"-Wdisabled-macro-expansion\"")
  323. #else
  324. #define SIMDE_DIAGNOSTIC_DISABLE_DISABLED_MACRO_EXPANSION_
  325. #endif
  326. /* Clang uses C11 generic selections to implement some AltiVec
  327. * functions, which triggers this diagnostic when not compiling
  328. * in C11 mode */
  329. #if HEDLEY_HAS_WARNING("-Wc11-extensions")
  330. #define SIMDE_DIAGNOSTIC_DISABLE_C11_EXTENSIONS_ \
  331. _Pragma("clang diagnostic ignored \"-Wc11-extensions\"")
  332. #else
  333. #define SIMDE_DIAGNOSTIC_DISABLE_C11_EXTENSIONS_
  334. #endif
  335. /* Clang sometimes triggers this warning in macros in the AltiVec and
  336. * NEON headers, or due to missing functions. */
  337. #if HEDLEY_HAS_WARNING("-Wvector-conversion")
  338. #define SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_ \
  339. _Pragma("clang diagnostic ignored \"-Wvector-conversion\"")
  340. /* For NEON, the situation with -Wvector-conversion in clang < 10 is
  341. * bad enough that we just disable the warning altogether. */
  342. #if defined(SIMDE_ARCH_ARM) && SIMDE_DETECT_CLANG_VERSION_NOT(10, 0, 0)
  343. #define SIMDE_DIAGNOSTIC_DISABLE_BUGGY_VECTOR_CONVERSION_ \
  344. SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_
  345. #endif
  346. #else
  347. #define SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_
  348. #endif
  349. #if !defined(SIMDE_DIAGNOSTIC_DISABLE_BUGGY_VECTOR_CONVERSION_)
  350. #define SIMDE_DIAGNOSTIC_DISABLE_BUGGY_VECTOR_CONVERSION_
  351. #endif
  352. /* SLEEF triggers this a *lot* in their headers */
  353. #if HEDLEY_HAS_WARNING("-Wignored-qualifiers")
  354. #define SIMDE_DIAGNOSTIC_DISABLE_IGNORED_QUALIFIERS_ \
  355. _Pragma("clang diagnostic ignored \"-Wignored-qualifiers\"")
  356. #elif HEDLEY_GCC_VERSION_CHECK(4, 3, 0)
  357. #define SIMDE_DIAGNOSTIC_DISABLE_IGNORED_QUALIFIERS_ \
  358. _Pragma("GCC diagnostic ignored \"-Wignored-qualifiers\"")
  359. #else
  360. #define SIMDE_DIAGNOSTIC_DISABLE_IGNORED_QUALIFIERS_
  361. #endif
  362. /* GCC emits this under some circumstances when using __int128 */
  363. #if HEDLEY_GCC_VERSION_CHECK(4, 8, 0)
  364. #define SIMDE_DIAGNOSTIC_DISABLE_PEDANTIC_ \
  365. _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
  366. #else
  367. #define SIMDE_DIAGNOSTIC_DISABLE_PEDANTIC_
  368. #endif
  369. /* MSVC doesn't like (__assume(0), code) and will warn about code being
  370. * unreachable, but we want it there because not all compilers
  371. * understand the unreachable macro and will complain if it is missing.
  372. * I'm planning on adding a new macro to Hedley to handle this a bit
  373. * more elegantly, but until then... */
  374. #if defined(HEDLEY_MSVC_VERSION)
  375. #define SIMDE_DIAGNOSTIC_DISABLE_UNREACHABLE_ __pragma(warning(disable : 4702))
  376. #else
  377. #define SIMDE_DIAGNOSTIC_DISABLE_UNREACHABLE_
  378. #endif
  379. /* This is a false positive from GCC in a few places. */
  380. #if HEDLEY_GCC_VERSION_CHECK(4, 7, 0)
  381. #define SIMDE_DIAGNOSTIC_DISABLE_MAYBE_UNINITIAZILED_ \
  382. _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
  383. #else
  384. #define SIMDE_DIAGNOSTIC_DISABLE_MAYBE_UNINITIAZILED_
  385. #endif
  386. #if defined(SIMDE_ENABLE_NATIVE_ALIASES)
  387. #define SIMDE_DISABLE_UNWANTED_DIAGNOSTICS_NATIVE_ALIASES_ \
  388. SIMDE_DIAGNOSTIC_DISABLE_RESERVED_ID_MACRO_
  389. #else
  390. #define SIMDE_DISABLE_UNWANTED_DIAGNOSTICS_NATIVE_ALIASES_
  391. #endif
  392. #define SIMDE_DISABLE_UNWANTED_DIAGNOSTICS \
  393. SIMDE_DISABLE_UNWANTED_DIAGNOSTICS_NATIVE_ALIASES_ \
  394. SIMDE_DIAGNOSTIC_DISABLE_PSABI_ \
  395. SIMDE_DIAGNOSTIC_DISABLE_NO_EMMS_INSTRUCTION_ \
  396. SIMDE_DIAGNOSTIC_DISABLE_SIMD_PRAGMA_DEPRECATED_ \
  397. SIMDE_DIAGNOSTIC_DISABLE_CONDITIONAL_UNINITIALIZED_ \
  398. SIMDE_DIAGNOSTIC_DISABLE_FLOAT_EQUAL_ \
  399. SIMDE_DIAGNOSTIC_DISABLE_NON_CONSTANT_AGGREGATE_INITIALIZER_ \
  400. SIMDE_DIAGNOSTIC_DISABLE_EXTRA_SEMI_ \
  401. SIMDE_DIAGNOSTIC_DISABLE_VLA_ \
  402. SIMDE_DIAGNOSTIC_DISABLE_USED_BUT_MARKED_UNUSED_ \
  403. SIMDE_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION_ \
  404. SIMDE_DIAGNOSTIC_DISABLE_PASS_FAILED_ \
  405. SIMDE_DIAGNOSTIC_DISABLE_CPP98_COMPAT_PEDANTIC_ \
  406. SIMDE_DIAGNOSTIC_DISABLE_CPP11_LONG_LONG_ \
  407. SIMDE_DIAGNOSTIC_DISABLE_BUGGY_UNUSED_BUT_SET_VARIBALE_ \
  408. SIMDE_DIAGNOSTIC_DISABLE_BUGGY_VECTOR_CONVERSION_
  409. #endif /* !defined(SIMDE_DIAGNOSTIC_H) */