diff --git a/include/wx/html/helpctrl.h b/include/wx/html/helpctrl.h
index 6ceaac9f01..a613f8cf3a 100644
--- a/include/wx/html/helpctrl.h
+++ b/include/wx/html/helpctrl.h
@@ -87,7 +87,7 @@ public:
virtual bool LoadFile(const wxString& file = wxT("")) override;
virtual bool DisplaySection(int sectionNo) override;
virtual bool DisplaySection(const wxString& section) override { return Display(section); }
- virtual bool DisplayBlock(long blockNo) override { return DisplaySection(blockNo); }
+ virtual bool DisplayBlock(long blockNo) override { return DisplaySection(static_cast(blockNo)); }
virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos) override;
virtual void SetFrameParameters(const wxString& titleFormat,
diff --git a/include/wx/protocol/protocol.h b/include/wx/protocol/protocol.h
index 2c465ed223..bca2e2c852 100644
--- a/include/wx/protocol/protocol.h
+++ b/include/wx/protocol/protocol.h
@@ -88,7 +88,7 @@ public:
// override wxSocketBase::SetTimeout function to avoid that the internal
// m_uiDefaultTimeout goes out-of-sync:
virtual void SetTimeout(long seconds) override
- { SetDefaultTimeout(seconds); }
+ { SetDefaultTimeout(static_cast(seconds)); }
// logging support: each wxProtocol object may have the associated logger
diff --git a/include/wx/selstore.h b/include/wx/selstore.h
index 20dee1cd07..290332e640 100644
--- a/include/wx/selstore.h
+++ b/include/wx/selstore.h
@@ -85,8 +85,13 @@ public:
// return the total number of selected items
unsigned GetSelectedCount() const
{
- return m_defaultState ? m_count - m_itemsSel.GetCount()
- : m_itemsSel.GetCount();
+ // we can we never have more than UINT_MAX selected items, knowing that
+ // we store the total number of items in an unsigned m_count, so the
+ // cast is safe.
+ return static_cast(
+ m_defaultState ? m_count - m_itemsSel.GetCount()
+ : m_itemsSel.GetCount()
+ );
}
// type of a "cookie" used to preserve the iteration state, this is an
diff --git a/include/wx/string.h b/include/wx/string.h
index 32a313e6d2..b5cc276113 100644
--- a/include/wx/string.h
+++ b/include/wx/string.h
@@ -553,7 +553,7 @@ private:
c->Reset();
// and remember the last used element
- LastUsedCacheElement() = c - cacheBegin;
+ LastUsedCacheElement() = static_cast(c - cacheBegin);
}
return c;
diff --git a/tests/allheaders.cpp b/tests/allheaders.cpp
index 69ba5e122c..5f8261fd9c 100644
--- a/tests/allheaders.cpp
+++ b/tests/allheaders.cpp
@@ -349,13 +349,14 @@
GCC_TURN_OFF(padded)
#endif // gcc >= 4.6
-// Do the same for clang too except here we don't bother with the individual
-// warnings and just enable the usual ones because clang mostly includes all
-// the useful warnings in them anyhow.
+// Do the same for clang too except here most of the useful warnings are
+// already included in -Wall, so we just need a few more.
#ifdef CLANG_TURN_ON
CLANG_TURN_ON(all)
CLANG_TURN_ON(extra)
CLANG_TURN_ON(pedantic)
+
+ CLANG_TURN_ON(shorten-64-to-32)
#endif // clang