Blender  V2.93
BLI_strict_flags.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
25 #ifdef __GNUC__
26 # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 /* gcc4.6+ only */
27 # pragma GCC diagnostic error "-Wsign-compare"
28 # endif
29 # if __GNUC__ >= 6 /* gcc6+ only */
30 # pragma GCC diagnostic error "-Wconversion"
31 # endif
32 # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408
33 /* gcc4.8+ only (behavior changed to ignore globals)*/
34 # pragma GCC diagnostic error "-Wshadow"
35 /* older gcc changed behavior with ternary */
36 # pragma GCC diagnostic error "-Wsign-conversion"
37 # endif
38 /* pedantic gives too many issues, developers can define this for own use */
39 # ifdef WARN_PEDANTIC
40 # pragma GCC diagnostic error "-Wpedantic"
41 # ifdef __clang__ /* pedantic causes clang error */
42 # pragma GCC diagnostic ignored "-Wlanguage-extension-token"
43 # endif
44 # endif
45 #endif
46 
47 #ifdef _MSC_VER
48 # pragma warning(error : 4018) /* signed/unsigned mismatch */
49 # pragma warning(error : 4244) /* conversion from 'type1' to 'type2', possible loss of data */
50 # pragma warning(error : 4245) /* conversion from 'int' to 'unsigned int' */
51 # pragma warning(error : 4267) /* conversion from 'size_t' to 'type', possible loss of data */
52 # pragma warning(error : 4305) /* truncation from 'type1' to 'type2' */
53 # pragma warning(error : 4389) /* signed/unsigned mismatch */
54 #endif