Ignition Common

API Reference

3.9.0
SuppressWarning.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 
19 #ifndef IGNITION_COMMON_SUPPRESSWARNING_HH_
20 #define IGNITION_COMMON_SUPPRESSWARNING_HH_
21 
22 #include <ignition/common/detail/SuppressWarning.hh>
23 
24 // This header contains cross-platform macros for suppressing warnings. Please
25 // only use these macros responsibly when you are certain that the compiler is
26 // producing a warning that is not applicable to the specific instance. Do not
27 // use these macros to ignore legitimate warnings, even if you may find them
28 // irritating.
29 
30 /*
31  * Usage example:
32  *
33  * SomeClass* ptr = CreatePtr();
34  * IGN_COMMON_WARN_IGNORE__DELETE_NON_VIRTUAL_DESTRUCTOR
35  * delete ptr;
36  * IGN_COMMON_WARN_RESUME__DELETE_NON_VIRTUAL_DESTRUCTOR
37  *
38  */
39 
40 // Be sure to call the IGN_COMMON_WARN_RESUME__XXXXX macro at the end of the
41 // block of code where the warning suppression is needed. Otherwise, you might
42 // inadvertently suppress legitimate warnings.
43 
44 // ---- List of available suppressions ----
45 
52 #define IGN_COMMON_WARN_IGNORE__DELETE_NON_VIRTUAL_DESTRUCTOR \
53  DETAIL_IGN_COMMON_WARN_IGNORE__DELETE_NON_VIRTUAL_DESTRUCTOR
54 
55 #define IGN_COMMON_WARN_RESUME__DELETE_NON_VIRTUAL_DESTRUCTOR \
56  DETAIL_IGN_COMMON_WARN_RESUME__DELETE_NON_VIRTUAL_DESTRUCTOR
57 
58 
64 #define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING \
65  DETAIL_IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
66 
67 #define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING \
68  DETAIL_IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
69 
70 
71 // TODO(anyone): Add more warning types as they become relevant.
72 // Do not add warning
73 // types to suppress unless they are genuinely necessary.
74 
75 #endif