From 2924a02a3561eed7899d5087f2a7a6c31529e18f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 1 Sep 2013 00:46:04 +0000 Subject: move strict compiler checks into a header so its easier to manage in one place (pragmas were copied around). also enable more strict warnings for BLF (which had some incorrect casts). --- source/blender/blenlib/BLI_strict_flags.h | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 source/blender/blenlib/BLI_strict_flags.h (limited to 'source/blender/blenlib/BLI_strict_flags.h') diff --git a/source/blender/blenlib/BLI_strict_flags.h b/source/blender/blenlib/BLI_strict_flags.h new file mode 100644 index 00000000000..0f41c95a035 --- /dev/null +++ b/source/blender/blenlib/BLI_strict_flags.h @@ -0,0 +1,38 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef __BLI_STRICT_FLAGS_H__ +#define __BLI_STRICT_FLAGS_H__ + +/** \file BLI_strict_flags.h + * \ingroup bli + * \brief Strict compiler flags for areas of code we want + * to ensure don't do conversions without us knowing about it. + */ + +#ifdef __GNUC__ +# pragma GCC diagnostic error "-Wsign-conversion" +# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 /* gcc4.6+ only */ +# pragma GCC diagnostic error "-Wsign-compare" +# pragma GCC diagnostic error "-Wconversion" +# endif +#endif + +#endif /* __BLI_STRICT_FLAGS_H__ */ -- cgit v1.2.3