1
0
forked from 0ad/0ad

Compile with -Wundef to detect stupid macro typos like "GCC_VER"

This was SVN commit r7756.
This commit is contained in:
Ykkrosh 2010-07-14 15:54:39 +00:00
parent bad3d04bc0
commit 1ea8ab60ee
2 changed files with 3 additions and 2 deletions

View File

@ -173,6 +173,7 @@ function package_set_build_flags()
-- "-Wformat=2", -- (useful sometimes, but a bit noisy, so skip it by default)
-- "-Wcast-qual", -- (useful for checking const-correctness, but a bit noisy, so skip it by default)
"-Wnon-virtual-dtor", -- (sometimes noisy but finds real bugs)
"-Wundef", -- (useful for finding macro name typos)
-- enable security features (stack checking etc) that shouldn't have
-- a significant effect on performance and can catch bugs

View File

@ -258,13 +258,13 @@ public:
wrapped_type r;
r.reserve(size);
// (/Wp64 causes a spurious warning here. see https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=253172)
#if MSC_VERSION
#ifdef _MSC_VER // (can't use MSC_VERSION here since this file is included by Atlas too)
#pragma warning(push)
#pragma warning(disable:4267)
#endif
for (size_t i = 0; i < size; ++i)
r.push_back(array[i]._Unwrap());
#if MSC_VERSION
#ifdef _MSC_VER
#pragma warning(pop)
#endif
return r;