MathFu
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Typedefs Friends Groups Pages
disable_warnings_begin.h
1 /*
2 * Copyright 2016 Google Inc. All rights reserved.
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 // Suppress pedantic warnings.
18 // To re-enable, include "mathfu/internal/disable_warnings_end.h".
19 //
20 // We need this to use anonymous unions and structs, which generate the
21 // the following warning in GCC and Clang,
22 // error: ISO C++ prohibits anonymous structs [-Werror=pedantic]
23 // The only way to suppress this warning is to turn off all pedantic warnings.
24 
25 #if defined(__GNUC__)
26 #pragma GCC diagnostic push
27 #pragma GCC diagnostic ignored "-Wpedantic"
28 #pragma GCC diagnostic ignored "-Wignored-qualifiers"
29 #endif // defined(__GNUC__)
30 
31 #if defined(__clang__)
32 #pragma clang diagnostic push
33 #pragma clang diagnostic ignored "-Wpedantic"
34 #pragma clang diagnostic ignored "-Wignored-qualifiers"
35 #endif // defined(__clang__)