Gazebo Utils

API Reference

2.2.0
gz/utils/SuppressWarning.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef GZ_UTILS__SUPPRESSWARNING_HH_
19 #define GZ_UTILS__SUPPRESSWARNING_HH_
20 
21 #include <gz/utils/detail/SuppressWarning.hh>
22 
23 // This header contains cross-platform macros for suppressing warnings. Please
24 // only use these macros responsibly when you are certain that the compiler is
25 // producing a warning that is not applicable to the specific instance. Do not
26 // use these macros to ignore legitimate warnings, even if you may find them
27 // irritating.
28 
29 /*
30  * Usage example:
31  *
32  * SomeClass *ptr = CreatePtr();
33  * GZ_UTILS_WARN_IGNORE__NON_VIRTUAL_DESTRUCTOR
34  * delete ptr;
35  * GZ_UTILS_WARN_RESUME__NON_VIRTUAL_DESTRUCTOR
36  *
37  */
38 
39 // Be sure to call the GZ_UTILS_WARN_RESUME__XXXXX macro at the end of the
40 // block of code where the warning suppression is needed. Otherwise, you might
41 // inadvertently suppress legitimate warnings.
42 
43 // ---- List of available suppressions ----
44 
51 #ifndef GZ_UTILS_WARN_IGNORE__NON_VIRTUAL_DESTRUCTOR
52  #define GZ_UTILS_WARN_IGNORE__NON_VIRTUAL_DESTRUCTOR \
53  DETAIL_GZ_UTILS_WARN_IGNORE__NON_VIRTUAL_DESTRUCTOR
54 #endif
55 
56 #ifndef GZ_UTILS_WARN_RESUME__NON_VIRTUAL_DESTRUCTOR
57  #define GZ_UTILS_WARN_RESUME__NON_VIRTUAL_DESTRUCTOR \
58  DETAIL_GZ_UTILS_WARN_RESUME__NON_VIRTUAL_DESTRUCTOR
59 #endif
60 
66 #ifndef GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
67  #define GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING \
68  DETAIL_GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
69 #endif
70 
71 #ifndef GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
72  #define GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING \
73  DETAIL_GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
74 #endif
75 
78 #ifndef GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION
79  #define GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION \
80  DETAIL_GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION
81 #endif
82 
83 #ifndef GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION
84  #define GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION \
85  DETAIL_GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION
86 #endif
87 
88 // TODO(anyone): Add more warning types as they become relevant.
89 // Do not add warning types to suppress unless they are genuinely necessary.
90 
91 #endif // GZ_UTILS__SUPPRESSWARNING_HH_