ArmNN  NotReleased
Conversion.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #if __GNUC__
9 # define ARMNN_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 ARMNN_NO_CONVERSION_WARN_END \
15  _Pragma("GCC diagnostic pop")
16 
17 #elif __clang__
18 # define ARMNN_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 ARMNN_NO_CONVERSION_WARN_END \
24  _Pragma("clang diagnostic pop")
25 
26 #elif defined (_MSC_VER)
27 # define ARMNN_NO_CONVERSION_WARN_BEGIN \
28  __pragma(warning( push )) \
29  __pragma(warning(disable : 4101)) \
30  __pragma(warning(disable : 4267))
31 
32 # define ARMNN_NO_CONVERSION_WARN_END \
33  __pragma(warning( pop ))
34 
35 #else
36 # define ARMNN_NO_CONVERSION_WARN_BEGIN
37 # define ARMNN_NO_CONVERSION_WARN_END
38 #endif
39 
40 #define ARMNN_SUPRESS_CONVERSION_WARNING(func) \
41 ARMNN_NO_CONVERSION_WARN_BEGIN \
42 func; \
43 ARMNN_NO_CONVERSION_WARN_END