Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_strict_flags.h
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| #pragma once | #pragma once | ||||
| /** \file | /** \file | ||||
| * \ingroup bli | * \ingroup bli | ||||
| * \brief Strict compiler flags for areas of code we want | * \brief Strict compiler flags for areas of code we want | ||||
| * to ensure don't do conversions without us knowing about it. | * to ensure don't do conversions without us knowing about it. | ||||
| */ | */ | ||||
| #ifdef __GNUC__ | #ifdef __GNUC__ | ||||
| # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 /* gcc4.6+ only */ | |||||
| # pragma GCC diagnostic error "-Wsign-compare" | # pragma GCC diagnostic error "-Wsign-compare" | ||||
| # endif | |||||
| # if __GNUC__ >= 6 /* gcc6+ only */ | |||||
| # pragma GCC diagnostic error "-Wconversion" | # pragma GCC diagnostic error "-Wconversion" | ||||
| # endif | |||||
| # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 | |||||
| /* gcc4.8+ only (behavior changed to ignore globals). */ | |||||
| # pragma GCC diagnostic error "-Wshadow" | # pragma GCC diagnostic error "-Wshadow" | ||||
| /* older gcc changed behavior with ternary */ | |||||
| # pragma GCC diagnostic error "-Wsign-conversion" | # pragma GCC diagnostic error "-Wsign-conversion" | ||||
| # endif | |||||
| /* pedantic gives too many issues, developers can define this for own use */ | /* pedantic gives too many issues, developers can define this for own use */ | ||||
| # ifdef WARN_PEDANTIC | # ifdef WARN_PEDANTIC | ||||
| # pragma GCC diagnostic error "-Wpedantic" | # pragma GCC diagnostic error "-Wpedantic" | ||||
| # ifdef __clang__ /* pedantic causes clang error */ | # ifdef __clang__ /* pedantic causes clang error */ | ||||
| # pragma GCC diagnostic ignored "-Wlanguage-extension-token" | # pragma GCC diagnostic ignored "-Wlanguage-extension-token" | ||||
| # endif | # endif | ||||
| # endif | # endif | ||||
| #endif | #endif | ||||
| Show All 9 Lines | |||||