@@ -88,11 +88,26 @@ if(MSVC)
8888 # see https://msdn.microsoft.com/en-us/library/074af4b6.aspx
8989 add_compile_options ("/wd4503" )
9090
91- # suppress C4267 - VC++ complains whenever we implicitly convert an integer to
92- # a smaller type, and most of the time this is just conversion from 64 to 32 bits
93- # for things like vector sizes, which are never that big anyway .
91+ # suppress C4267 - VC++ considers a narrowing conversion from size_t to a smaller
92+ # integer type a warning. this is technically correct but there are so many instances
93+ # of this that we don't want to fix, so... .
9494 add_compile_options ("/wd4267" )
9595
96+ # suppress C4251 - VC++ will warn when exporting an entire class which contains members
97+ # referencing unexported compound types is unsafe. because we don't guarantee a stable API
98+ # for our exports, we don't really care about this, so we choose to be lazy and continue to
99+ # export entire classes instead of exporting on a method-by-method basis
100+ add_compile_options ("/wd4251" )
101+
102+ # suppress C4068 - VC++ will warn for unknown pragmas by default. this is equivalent to gcc
103+ # -Wno-unknown-pragmas. we could work around this with sufficiently complex macros
104+ add_compile_options ("/wd4068" )
105+
106+ # suppress C4244 - VC++ warns by default (with /Wall) about narrowing conversions that may lose data
107+ # (such as double -> int or int32_t -> int16_t). dfhack has many of these, mostly related to Lua
108+ # this is equivalent to gcc -Wno_conversions which is the default as gcc -Wall doesn't enable -Wconversions
109+ add_compile_options ("/wd4244" )
110+
96111 # MSVC panics if an object file contains more than 65,279 sections. this
97112 # happens quite frequently with code that uses templates, such as vectors.
98113 add_compile_options ("/bigobj" )
0 commit comments