Blender  V3.3
BLI_strict_flags.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
11 #ifdef __GNUC__
12 # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 /* gcc4.6+ only */
13 # pragma GCC diagnostic error "-Wsign-compare"
14 # endif
15 # if __GNUC__ >= 6 /* gcc6+ only */
16 # pragma GCC diagnostic error "-Wconversion"
17 # endif
18 # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408
19 /* gcc4.8+ only (behavior changed to ignore globals). */
20 # pragma GCC diagnostic error "-Wshadow"
21 /* older gcc changed behavior with ternary */
22 # pragma GCC diagnostic error "-Wsign-conversion"
23 # endif
24 /* pedantic gives too many issues, developers can define this for own use */
25 # ifdef WARN_PEDANTIC
26 # pragma GCC diagnostic error "-Wpedantic"
27 # ifdef __clang__ /* pedantic causes clang error */
28 # pragma GCC diagnostic ignored "-Wlanguage-extension-token"
29 # endif
30 # endif
31 #endif
32 
33 #ifdef _MSC_VER
34 # pragma warning(error : 4018) /* signed/unsigned mismatch */
35 # pragma warning(error : 4244) /* conversion from 'type1' to 'type2', possible loss of data */
36 # pragma warning(error : 4245) /* conversion from 'int' to 'unsigned int' */
37 # pragma warning(error : 4267) /* conversion from 'size_t' to 'type', possible loss of data */
38 # pragma warning(error : 4305) /* truncation from 'type1' to 'type2' */
39 # pragma warning(error : 4389) /* signed/unsigned mismatch */
40 #endif