Commit | Line | Data |
---|---|---|
e2882c85 | 1 | /* Copyright (C) 2017-2018 Free Software Foundation, Inc. |
f4906a9a | 2 | |
f4906a9a PA |
3 | This program is free software; you can redistribute it and/or modify |
4 | it under the terms of the GNU General Public License as published by | |
5 | the Free Software Foundation; either version 3 of the License, or | |
6 | (at your option) any later version. | |
7 | ||
8 | This program is distributed in the hope that it will be useful, | |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | GNU General Public License for more details. | |
12 | ||
13 | You should have received a copy of the GNU General Public License | |
14 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
15 | ||
e9cb46ab L |
16 | #ifndef DIAGNOSTICS_H |
17 | #define DIAGNOSTICS_H | |
f4906a9a PA |
18 | |
19 | #ifdef __GNUC__ | |
20 | # define DIAGNOSTIC_PUSH _Pragma ("GCC diagnostic push") | |
21 | # define DIAGNOSTIC_POP _Pragma ("GCC diagnostic pop") | |
22 | # define DIAGNOSTIC_IGNORE(option) \ | |
23 | _Pragma (STRINGIFY (GCC diagnostic ignored option)) | |
24 | #else | |
25 | # define DIAGNOSTIC_PUSH | |
26 | # define DIAGNOSTIC_POP | |
27 | # define DIAGNOSTIC_IGNORE(option) | |
28 | #endif | |
29 | ||
8b5a7a6e SM |
30 | #if defined (__clang__) /* clang */ |
31 | ||
f4906a9a | 32 | # define DIAGNOSTIC_IGNORE_SELF_MOVE DIAGNOSTIC_IGNORE ("-Wself-move") |
d1435379 SM |
33 | # define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER \ |
34 | DIAGNOSTIC_IGNORE ("-Wdeprecated-register") | |
8b5a7a6e SM |
35 | # define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \ |
36 | DIAGNOSTIC_IGNORE ("-Wunused-function") | |
cfa27c39 SM |
37 | # if __has_warning ("-Wenum-compare-switch") |
38 | # define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES \ | |
39 | DIAGNOSTIC_IGNORE ("-Wenum-compare-switch") | |
40 | # else | |
41 | # define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES | |
42 | # endif | |
8b5a7a6e SM |
43 | #elif defined (__GNUC__) /* GCC */ |
44 | ||
45 | # define DIAGNOSTIC_IGNORE_SELF_MOVE | |
46 | # define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER | |
47 | # define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \ | |
48 | DIAGNOSTIC_IGNORE ("-Wunused-function") | |
0436426c | 49 | # define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES |
8b5a7a6e SM |
50 | |
51 | #else /* Other compilers */ | |
52 | ||
f4906a9a | 53 | # define DIAGNOSTIC_IGNORE_SELF_MOVE |
d1435379 | 54 | # define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER |
8b5a7a6e | 55 | # define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION |
0436426c SM |
56 | # define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES |
57 | ||
f4906a9a PA |
58 | #endif |
59 | ||
e9cb46ab | 60 | #endif /* DIAGNOSTICS_H */ |