Blender V4.3
BLI_strict_flags.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
17#ifdef __GNUC__
18/* NOTE(@ideasman42): CLANG behaves slightly differently to GCC,
19 * these can be enabled but do so carefully as they can introduce build-errors. */
20# if !defined(__clang__)
21# pragma GCC diagnostic error "-Wsign-compare"
22# pragma GCC diagnostic error "-Wconversion"
23# pragma GCC diagnostic error "-Wshadow"
24# pragma GCC diagnostic error "-Wsign-conversion"
25# endif
26/* pedantic gives too many issues, developers can define this for own use */
27# ifdef WARN_PEDANTIC
28# pragma GCC diagnostic error "-Wpedantic"
29# ifdef __clang__ /* pedantic causes clang error */
30# pragma GCC diagnostic ignored "-Wlanguage-extension-token"
31# endif
32# endif
33#endif
34
35#ifdef _MSC_VER
36# pragma warning(error : 4018) /* signed/unsigned mismatch */
37# pragma warning(error : 4244) /* conversion from 'type1' to 'type2', possible loss of data */
38# pragma warning(error : 4245) /* conversion from 'int' to 'unsigned int' */
39# pragma warning(error : 4267) /* conversion from 'size_t' to 'type', possible loss of data */
40# pragma warning(error : 4305) /* truncation from 'type1' to 'type2' */
41# pragma warning(error : 4389) /* signed/unsigned mismatch */
42#endif