suppress_warnings.h
Go to the documentation of this file.
1 #pragma once
2 
3 // SPDX-License-Identifier: BSD-3-Clause
4 // SPDX-FileCopyrightText: Czech Technical University in Prague
5 
26 #if defined __clang__
27 
28 #define CRAS_IGNORE_DEPRECATED_WARNING_BEGIN \
29  _Pragma("clang diagnostic push") \
30  _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
31 #define CRAS_IGNORE_DEPRECATED_WARNING_END \
32  _Pragma("clang diagnostic pop")
33 
34 #elif defined __GNUC__
35 
36 #define CRAS_IGNORE_DEPRECATED_WARNING_BEGIN \
37  _Pragma("GCC diagnostic push") \
38  _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
39 #define CRAS_IGNORE_DEPRECATED_WARNING_END \
40  _Pragma("GCC diagnostic pop")
41 
42 #elif defined _MSC_VER
43 
44 #define CRAS_IGNORE_DEPRECATED_WARNING_BEGIN \
45  __pragma(warning(push)) \
46  __pragma(warning(disable: 4996))
47 #define CRAS_IGNORE_DEPRECATED_WARNING_END \
48  __pragma(warning(pop))
49 
50 #else
51 
52 #define CRAS_IGNORE_DEPRECATED_WARNING_BEGIN
53 #define CRAS_IGNORE_DEPRECATED_WARNING_END
54 
55 #endif
56 
71 #if defined __clang__
72 
73 #define CRAS_IGNORE_PRINTF_SECURITY_WARNING_BEGIN \
74  _Pragma("clang diagnostic push") \
75  _Pragma("clang diagnostic ignored \"-Wformat-security\"")
76 #define CRAS_IGNORE_PRINTF_SECURITY_WARNING_END \
77  _Pragma("clang diagnostic pop")
78 
79 #elif defined __GNUC__
80 
81 #define CRAS_IGNORE_PRINTF_SECURITY_WARNING_BEGIN \
82  _Pragma("GCC diagnostic push") \
83  _Pragma("GCC diagnostic ignored \"-Wformat-security\"")
84 #define CRAS_IGNORE_PRINTF_SECURITY_WARNING_END \
85  _Pragma("GCC diagnostic pop")
86 
87 #else
88 
89 #define CRAS_IGNORE_PRINTF_SECURITY_WARNING_BEGIN
90 #define CRAS_IGNORE_PRINTF_SECURITY_WARNING_END
91 
92 #endif


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Sat Jun 17 2023 02:32:53