• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright © 2019 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #if __GNUC__
9 #   define ARM_PIPE_NO_CONVERSION_WARN_BEGIN \
10     _Pragma("GCC diagnostic push")  \
11     _Pragma("GCC diagnostic ignored \"-Wconversion\"") \
12     _Pragma("GCC diagnostic ignored \"-Wsign-conversion\"")
13 
14 #   define ARM_PIPE_NO_CONVERSION_WARN_END \
15     _Pragma("GCC diagnostic pop")
16 
17 #elif __clang__
18 #   define ARM_PIPE_NO_CONVERSION_WARN_BEGIN \
19     _Pragma("clang diagnostic push")  \
20     _Pragma("clang diagnostic ignored \"-Wconversion\"") \
21     _Pragma("clang diagnostic ignored \"-Wsign-conversion\"")
22 
23 #   define ARM_PIPE_NO_CONVERSION_WARN_END \
24     _Pragma("clang diagnostic pop")
25 
26 #elif defined (_MSC_VER)
27 #   define ARM_PIPE_NO_CONVERSION_WARN_BEGIN \
28     __pragma(warning( push )) \
29     __pragma(warning(disable : 4101)) \
30     __pragma(warning(disable : 4267))
31 
32 #   define ARM_PIPE_NO_CONVERSION_WARN_END \
33     __pragma(warning( pop ))
34 
35 #else
36 #   define ARM_PIPE_NO_CONVERSION_WARN_BEGIN
37 #   define ARM_PIPE_NO_CONVERSION_WARN_END
38 #endif
39 
40 #define ARM_PIPE_SUPRESS_CONVERSION_WARNING(func) \
41 ARM_PIPE_NO_CONVERSION_WARN_BEGIN \
42 func; \
43 ARM_PIPE_NO_CONVERSION_WARN_END
44