Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
pch_warnings.h
Go to the documentation of this file.
1/* Copyright (C) 2021 Wildfire Games.
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining
4 * a copy of this software and associated documentation files (the
5 * "Software"), to deal in the Software without restriction, including
6 * without limitation the rights to use, copy, modify, merge, publish,
7 * distribute, sublicense, and/or sell copies of the Software, and to
8 * permit persons to whom the Software is furnished to do so, subject to
9 * the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef INCLUDED_PCH_WARNINGS
24#define INCLUDED_PCH_WARNINGS
25
26#include "lib/sysdep/compiler.h" // MSC_VERSION
27
28#if MSC_VERSION
29// .. unimportant but not entirely senseless W4
30# pragma warning(disable:4201) // nameless struct (Matrix3D)
31# pragma warning(disable:4244) // conversion from uintN to uint8
32// .. always disabled W4
33# pragma warning(disable:4103) // alignment changed after including header (boost has #pragma pack/pop in separate headers)
34# pragma warning(disable:4127) // conditional expression is constant; rationale: see STMT in lib.h.
35# pragma warning(disable:4324) // structure was padded due to __declspec(align())
36# pragma warning(disable:4574) // macro is defined to be 0
37# pragma warning(disable:4456) // hides previous local declaration
38# pragma warning(disable:4355) // 'this' used in base member initializer list
39# pragma warning(disable:4512) // assignment operator could not be generated
40# pragma warning(disable:4718) // recursive call has no side effects, deleting
41# pragma warning(disable:4786) // identifier truncated to 255 chars
42# pragma warning(disable:4996) // function is deprecated
43# pragma warning(disable:6011) // dereferencing NULL pointer
44# pragma warning(disable:6246) // local declaration hides declaration of the same name in outer scope
45# pragma warning(disable:6326) // potential comparison of a constant with another constant
46# pragma warning(disable:6334) // sizeof operator applied to an expression with an operator might yield unexpected results
47// .. Intel-specific
48# if ICC_VERSION
49# pragma warning(disable:383) // value copied to temporary, reference to temporary used
50# pragma warning(disable:981) // operands are evaluated in unspecified order
51# pragma warning(disable:1418) // external function definition with no prior declaration (raised for all non-static function templates)
52# pragma warning(disable:1572) // floating-point equality and inequality comparisons are unreliable
53# pragma warning(disable:1684) // conversion from pointer to same-sized integral type
54# pragma warning(disable:1786) // function is deprecated (disabling 4996 isn't sufficient)
55# pragma warning(disable:2415) // variable of static storage duration was declared but never referenced (raised by Boost)
56# endif
57// .. disabled by default in W4, ENABLE them
58# pragma warning(default:4062) // enumerator is not handled
59# pragma warning(default:4254) // [bit field] conversion, possible loss of data
60# pragma warning(default:4265) // class has virtual functions, but destructor is not virtual
61# pragma warning(default:4296) // [unsigned comparison vs. 0 =>] expression is always false
62# pragma warning(default:4545 4546 4547 4549) // ill-formed comma expressions; exclude 4548 since _SECURE_SCL triggers it frequently
63# pragma warning(default:4557) // __assume contains effect
64//# pragma warning(default:4710) // function not inlined (often happens in STL)
65# pragma warning(default:4905) // wide string literal cast to LPSTR
66# pragma warning(default:4906) // string literal cast to LPWSTR
67# pragma warning(default:4928) // illegal copy-initialization; more than one user-defined conversion has been implicitly applied
68# pragma warning(default:4946) // reinterpret_cast used between related classes
69// .. disabled by default in W4, leave them that way
70//# pragma warning(default:4191) // unsafe conversion (false alarms for function pointers)
71//# pragma warning(default:4263) // member function does not override any base class virtual member function (happens in GUI)
72//# pragma warning(default:4555) // expression has no effect (triggered by STL unused)
73//# pragma warning(default:4619) // #pragma warning: there is no [such] warning number (false alarms in STL)
74//# pragma warning(default:4668) // not defined as a preprocessor macro, replacing with '0' (frequent in Windows)
75#endif
76
77#endif // #ifndef INCLUDED_PCH_WARNINGS